Beispiel #1
0
 /**
  * Delete all routes from a task
  * @param string $sProcessUID
  * @param string $sTaskUID
  * @return boolean
  */
 public function deleteAllGatewayOfTask($sProcessUID = '', $sTaskUID = '', $bAll = false)
 {
     try {
         $oProcess = new Process();
         $aFields = $oProcess->load($sProcessUID);
         $oTask = new Task();
         $aFields = $oTask->load($sTaskUID);
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(GatewayPeer::PRO_UID, $sProcessUID);
         $oCriteria->add(GatewayPeer::TAS_UID, $sTaskUID);
         GatewayPeer::doDelete($oCriteria);
         if ($bAll) {
             $oCriteria = new Criteria('workflow');
             $oCriteria->add(GatewayPeer::PRO_UID, $sProcessUID);
             $oCriteria->add(GatewayPeer::GAT_NEXT_TASK, $sTaskUID);
             GatewayPeer::doDelete($oCriteria);
         }
         return true;
     } catch (Exception $oError) {
         throw $oError;
     }
 }
Beispiel #2
0
 /**
  * Removes this object from datastore and sets delete attribute.
  *
  * @param      Connection $con
  * @return     void
  * @throws     PropelException
  * @see        BaseObject::setDeleted()
  * @see        BaseObject::isDeleted()
  */
 public function delete($con = null)
 {
     if ($this->isDeleted()) {
         throw new PropelException("This object has already been deleted.");
     }
     if ($con === null) {
         $con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
     }
     try {
         $con->begin();
         GatewayPeer::doDelete($this, $con);
         $this->setDeleted(true);
         $con->commit();
     } catch (PropelException $e) {
         $con->rollback();
         throw $e;
     }
 }