Exemplo n.º 1
0
 /**
  * Notify the formatter of an exception
  *
  * @param  Exception $exception
  * @return void
  */
 public function notifyException($exception)
 {
     $msg = $exception->getMessage();
     if (Doctrine::debug()) {
         $msg .= "\n" . $exception->getTraceAsString();
     }
     echo $this->_formatter->format($msg, 'ERROR') . "\n";
 }
Exemplo n.º 2
0
 /**
  * delete
  * single shot delete
  * deletes all records from this collection
  * and uses only one database query to perform this operation
  *
  * @return Doctrine_Collection
  */
 public function delete(Doctrine_Connection $conn = null)
 {
     if ($conn == null) {
         $conn = $this->_table->getConnection();
     }
     $conn->beginTransaction();
     $conn->transaction->addCollection($this);
     foreach ($this as $key => $record) {
         $record->delete($conn);
     }
     Doctrine::debug(true);
     $conn->commit();
     $this->data = array();
     return $this;
 }