Example #1
0
 public function delete($con = null)
 {
     foreach (sfMixer::getCallables('BaseRecord:delete:pre') as $callable) {
         $ret = call_user_func($callable, $this, $con);
         if ($ret) {
             return;
         }
     }
     if ($this->isDeleted()) {
         throw new PropelException("This object has already been deleted.");
     }
     if ($con === null) {
         $con = Propel::getConnection(RecordPeer::DATABASE_NAME);
     }
     try {
         $con->begin();
         RecordPeer::doDelete($this, $con);
         $this->setDeleted(true);
         $con->commit();
     } catch (PropelException $e) {
         $con->rollback();
         throw $e;
     }
     foreach (sfMixer::getCallables('BaseRecord:delete:post') as $callable) {
         call_user_func($callable, $this, $con);
     }
 }
Example #2
0
 /**
  * Delete
  */
 public function executeDelete()
 {
     $c = new Criteria();
     $c->add(RecordPeer::DOMAIN_ID, $this->domain->getId());
     RecordPeer::doDelete($c);
     $this->domain->delete();
     return $this->renderJson(array("success" => true, "info" => "Domain deleted."));
 }