Example #1
0
 public function delete(Doctrine_Connection $conn = null)
 {
     if ($conn == null) {
         $conn = $this->_table->getConnection();
     }
     try {
         $conn->beginTransaction();
         foreach ($this->_table->getTemplates() as $template) {
             if (method_exists($template, 'onObjectDelete')) {
                 $template->setInvoker($this);
                 $template->onObjectDelete($conn);
             }
         }
         $this->updateEntitiesTimestamp();
         $ret = parent::delete($conn);
         $conn->commit();
     } catch (Exception $e) {
         $conn->rollback();
         throw $e;
     }
     return $ret;
 }