/** * 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(EmailServerPeer::DATABASE_NAME); } try { $con->begin(); EmailServerPeer::doDelete($this, $con); $this->setDeleted(true); $con->commit(); } catch (PropelException $e) { $con->rollback(); throw $e; } }
/** * Delete Email Server * * @param string $emailServerUid Unique id of Email Server * * return void */ public function delete($emailServerUid) { try { //Verify data $this->throwExceptionIfNotExistsEmailServer($emailServerUid, $this->arrayFieldNameForException["emailServerUid"]); $this->throwExceptionIfIsDefault($emailServerUid, $this->arrayFieldNameForException["emailServerUid"]); $criteria = $this->getEmailServerCriteria(); $criteria->add(\EmailServerPeer::MESS_UID, $emailServerUid, \Criteria::EQUAL); \EmailServerPeer::doDelete($criteria); } catch (\Exception $e) { throw $e; } }