Exemplo n.º 1
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(MessageTypePeer::DATABASE_NAME);
     }
     try {
         $con->begin();
         MessageTypePeer::doDelete($this, $con);
         $this->setDeleted(true);
         $con->commit();
     } catch (PropelException $e) {
         $con->rollback();
         throw $e;
     }
 }
Exemplo n.º 2
0
 /**
  * Delete Message-Type
  *
  * @param string $messageTypeUid Unique id of Message-Type
  *
  * return void
  */
 public function delete($messageTypeUid)
 {
     try {
         $this->throwExceptionIfNotExistsMessageType($messageTypeUid, $this->arrayFieldNameForException["messageTypeUid"]);
         //Delete Message-Type-Variable
         $criteria = new \Criteria("workflow");
         $criteria->add(\MessageTypeVariablePeer::MSGT_UID, $messageTypeUid, \Criteria::EQUAL);
         \MessageTypeVariablePeer::doDelete($criteria);
         //Delete Message-Type
         $criteria = $this->getMessageTypeCriteria();
         $criteria->add(\MessageTypePeer::MSGT_UID, $messageTypeUid, \Criteria::EQUAL);
         \MessageTypePeer::doDelete($criteria);
     } catch (\Exception $e) {
         throw $e;
     }
 }