Example #1
0
 /**
  * Single update Timer-Event
  *
  * @param string $timerEventUid Unique id of Timer-Event
  * @param array  $arrayData     Data
  *
  * return int Return integer
  */
 public function singleUpdate($timerEventUid, array $arrayData)
 {
     try {
         $cnn = \Propel::getConnection("workflow");
         try {
             $timerEvent = \TimerEventPeer::retrieveByPK($timerEventUid);
             $timerEvent->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
             if ($timerEvent->validate()) {
                 $cnn->begin();
                 $result = $timerEvent->save();
                 $cnn->commit();
                 //Return
                 return $result;
             } else {
                 $msg = "";
                 foreach ($timerEvent->getValidationFailures() as $validationFailure) {
                     $msg = $msg . ($msg != "" ? "\n" : "") . $validationFailure->getMessage();
                 }
                 throw new \Exception(\G::LoadTranslation("ID_REGISTRY_CANNOT_BE_UPDATED") . ($msg != "" ? "\n" . $msg : ""));
             }
         } catch (\Exception $e) {
             $cnn->rollback();
             throw $e;
         }
     } catch (\Exception $e) {
         throw $e;
     }
 }