Exemplo n.º 1
0
 /**
  * Delete Email-Event
  *
  * @param string $emailEventUid Unique id of Email-Event
  *
  * return void
  */
 public function delete($pro_uid, $emailEventUid, $passValidation = true)
 {
     try {
         //Verify data
         if($passValidation) {
             $this->verifyIfEmailEventExists($emailEventUid);
         
             //Delete file
             $filesManager = new \ProcessMaker\BusinessModel\FilesManager();
             $arrayData = $this->getEmailEventDataByUid($pro_uid, $emailEventUid); 
             $arrayData = array_change_key_case($arrayData, CASE_UPPER);
             if(sizeof($arrayData)) {
                 $prfUid = $arrayData['PRF_UID'];
                 $filesManager->deleteProcessFilesManager('',$prfUid);
             }
         }
         //Delete Email event
         $criteria = new \Criteria("workflow");
         $criteria->add(\EmailEventPeer::EMAIL_EVENT_UID, $emailEventUid, \Criteria::EQUAL);
         $result = \EmailEventPeer::doDelete($criteria);
         
     } catch (\Exception $e) {
         throw $e;
     }
 }
Exemplo n.º 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(EmailEventPeer::DATABASE_NAME);
     }
     try {
         $con->begin();
         EmailEventPeer::doDelete($this, $con);
         $this->setDeleted(true);
         $con->commit();
     } catch (PropelException $e) {
         $con->rollback();
         throw $e;
     }
 }