Beispiel #1
0
 /**
  * Rollback changes in a transaction.
  * @return void
  */
 public function rollback()
 {
     if (!$this->inTxn) {
         throw new DibiException('There is no active transaction.');
     }
     $this->driver->rollback();
     $this->inTxn = FALSE;
     dibi::notify($this, 'rollback');
 }
Beispiel #2
0
 /**
  * Construct an dibi driver exception.
  *
  * @param string  Message describing the exception
  * @param int     Some code
  * @param  string SQL command
  */
 public function __construct($message = NULL, $code = 0, $sql = NULL)
 {
     parent::__construct($message, (int) $code);
     $this->sql = $sql;
     dibi::notify(NULL, 'exception', $this);
 }