コード例 #1
0
ファイル: DynaForm.php プロジェクト: emildev35/processmaker
 /**
  * Update DynaForm
  *
  * @param string $dynaFormUid Unique id of DynaForm
  * @param array  $arrayData   Data
  *
  * return array Return data of the DynaForm updated
  */
 public function update($dynaFormUid, $arrayData)
 {
     try {
         $arrayData = array_change_key_case($arrayData, CASE_UPPER);
         //Verify data
         $this->throwExceptionIfNotExistsDynaForm($dynaFormUid, "", $this->arrayFieldNameForException["dynaFormUid"]);
         //Load DynaForm
         $dynaForm = new \Dynaform();
         $arrayDynaFormData = $dynaForm->Load($dynaFormUid);
         $processUid = $arrayDynaFormData["PRO_UID"];
         //Verify data
         $process = new \ProcessMaker\BusinessModel\Process();
         $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false);
         if (isset($arrayData["DYN_TITLE"])) {
             $this->throwExceptionIfExistsTitle($processUid, $arrayData["DYN_TITLE"], $this->arrayFieldNameForException["dynaFormTitle"], $dynaFormUid);
         }
         //Update
         $arrayData["DYN_UID"] = $dynaFormUid;
         $result = $dynaForm->update($arrayData);
         //Return
         unset($arrayData["DYN_UID"]);
         if (!$this->formatFieldNameInUppercase) {
             $arrayData = array_change_key_case($arrayData, CASE_LOWER);
         }
         return $arrayData;
     } catch (\Exception $e) {
         throw $e;
     }
 }