本文整理汇总了PHP中InputDocument::create方法的典型用法代码示例。如果您正苦于以下问题:PHP InputDocument::create方法的具体用法?PHP InputDocument::create怎么用?PHP InputDocument::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputDocument
的用法示例。
在下文中一共展示了InputDocument::create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: createTest
function createTest($aTestData, $aFields)
{
$oInputDocument = new InputDocument();
try {
return $oInputDocument->create($aFields);
} catch (Exception $oError) {
return $oError;
}
}
示例3: create
/**
* Create InputDocument for a Process
*
* @param string $processUid Unique id of Process
* @param array $arrayData Data
*
* return array Return data of the new InputDocument created
*/
public function create($processUid, $arrayData)
{
try {
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
unset($arrayData["INP_DOC_UID"]);
//Verify data
$process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true);
$this->throwExceptionIfExistsTitle($processUid, $arrayData["INP_DOC_TITLE"], $this->arrayFieldNameForException["inputDocumentTitle"]);
//Flags
$flagDataDestinationPath = isset($arrayData["INP_DOC_DESTINATION_PATH"]) ? 1 : 0;
$flagDataTags = isset($arrayData["INP_DOC_TAGS"]) ? 1 : 0;
//Create
$inputDocument = new \InputDocument();
$arrayData["PRO_UID"] = $processUid;
$arrayData["INP_DOC_DESTINATION_PATH"] = $flagDataDestinationPath == 1 ? $arrayData["INP_DOC_DESTINATION_PATH"] : "";
$arrayData["INP_DOC_TAGS"] = $flagDataTags == 1 ? $arrayData["INP_DOC_TAGS"] : "";
$inputDocumentUid = $inputDocument->create($arrayData);
//Return
unset($arrayData["PRO_UID"]);
if ($flagDataDestinationPath == 0) {
unset($arrayData["INP_DOC_DESTINATION_PATH"]);
}
if ($flagDataTags == 0) {
unset($arrayData["INP_DOC_TAGS"]);
}
$arrayData = array_merge(array("INP_DOC_UID" => $inputDocumentUid), $arrayData);
if (!$this->formatFieldNameInUppercase) {
$arrayData = array_change_key_case($arrayData, CASE_LOWER);
}
return $arrayData;
} catch (\Exception $e) {
throw $e;
}
}
示例4: createInputRows
/**
* Create Input Documents Rows from an array, removing those Objects
* with the same UID, and recreaiting the records from the array data.
*
* @param $aInput array.
* @return void
*/
public function createInputRows ($aInput)
{
foreach ($aInput as $key => $row) {
$oInput = new InputDocument();
//unset ($row['TAS_UID']);
if ($oInput->InputExists( $row['INP_DOC_UID'] )) {
$oInput->remove( $row['INP_DOC_UID'] );
}
$res = $oInput->create( $row );
}
return;
}
示例5: 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());
}