本文整理汇总了PHP中InputDocument::update方法的典型用法代码示例。如果您正苦于以下问题:PHP InputDocument::update方法的具体用法?PHP InputDocument::update怎么用?PHP InputDocument::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputDocument
的用法示例。
在下文中一共展示了InputDocument::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveInputDoc
public function saveInputDoc($params)
{
require_once 'classes/model/InputDocument.php';
G::LoadClass('processMap');
$aData = array();
$aData['PRO_UID'] = $params->PRO_UID;
$aData['INP_DOC_UID'] = $params->INP_DOC_UID;
$aData['INP_DOC_TITLE'] = $params->INP_DOC_TITLE;
$aData['INP_DOC_FORM_NEEDED'] = $params->INP_DOC_FORM_NEEDED;
if ($aData['INP_DOC_FORM_NEEDED'] != 'VIRTUAL') {
$aData['INP_DOC_ORIGINAL'] = $params->INP_DOC_ORIGINAL;
} else {
$aData['INP_DOC_ORIGINAL'] = 'ORIGINAL';
}
$aData['INP_DOC_VERSIONING'] = $params->INP_DOC_VERSIONING;
$aData['INP_DOC_DESCRIPTION'] = $params->INP_DOC_DESCRIPTION;
$aData['INP_DOC_DESTINATION_PATH'] = $params->INP_DOC_DESTINATION_PATH;
$aData['INP_DOC_TAGS'] = $params->INP_DOC_TAGS;
$oInputDocument = new InputDocument();
if ($aData['INP_DOC_UID'] == '') {
unset($aData['INP_DOC_UID']);
$oInputDocument->create($aData);
$this->msg = G::LoadTranslation('ID_INPUT_DOC_SUCCESS_NEW');
} else {
$oInputDocument->update($aData);
$this->msg = G::LoadTranslation('ID_INPUT_DOC_SUCCESS_UPDATE');
}
//refresh dbarray with the last change in inputDocument
$oMap = new processMap();
$oCriteria = $oMap->getInputDocumentsCriteria($aData['PRO_UID']);
$this->success = true;
}
示例2: update
/**
* Update InputDocument
*
* @param string $inputDocumentUid Unique id of InputDocument
* @param array $arrayData Data
*
* return array Return data of the InputDocument updated
*/
public function update($inputDocumentUid, $arrayData)
{
try {
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
//Verify data
$this->throwExceptionIfNotExistsInputDocument($inputDocumentUid, "", $this->arrayFieldNameForException["inputDocumentUid"]);
//Load InputDocument
$inputDocument = new \InputDocument();
$arrayInputDocumentData = $inputDocument->load($inputDocumentUid);
$processUid = $arrayInputDocumentData["PRO_UID"];
//Verify data
$process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false);
if (isset($arrayData["INP_DOC_TITLE"])) {
$this->throwExceptionIfExistsTitle($processUid, $arrayData["INP_DOC_TITLE"], $this->arrayFieldNameForException["inputDocumentTitle"], $inputDocumentUid);
}
//Update
$arrayData["INP_DOC_UID"] = $inputDocumentUid;
$result = $inputDocument->update($arrayData);
\G::LoadClass('pmDynaform');
$pmDynaform = new \pmDynaform();
$pmDynaform->synchronizeInputDocument($processUid, $arrayData);
//Return
unset($arrayData["INP_DOC_UID"]);
if (!$this->formatFieldNameInUppercase) {
$arrayData = array_change_key_case($arrayData, CASE_LOWER);
}
return $arrayData;
} catch (\Exception $e) {
throw $e;
}
}
示例3: InputDocument
$oDataset1->next();
$aRow1 = $oDataset1->getRow();
if ($aRow1['INPUTS']) {
$flag = false;
}
}
print $flag;
break;
default:
require_once 'classes/model/InputDocument.php';
G::LoadClass('processMap');
$oInputDocument = new InputDocument();
if (isset($_POST['form'])) {
$aData = $_POST['form'];
} else {
$aData = $_POST;
}
if ($aData['INP_DOC_UID'] == '') {
unset($aData['INP_DOC_UID']);
$oInputDocument->create($aData);
} else {
$oInputDocument->update($aData);
}
//refresh dbarray with the last change in inputDocument
$oMap = new processMap();
$oCriteria = $oMap->getInputDocumentsCriteria($aData['PRO_UID']);
break;
}
} catch (Exception $oException) {
die($oException->getMessage());
}
示例4: updateTest
function updateTest($aTestData, $aFields)
{
$oInputDocument = new InputDocument();
try {
return $oInputDocument->update($aFields);
} catch (Exception $oError) {
return $oError;
}
}