Ejemplo n.º 1
0
 /**
  * Begins a transaction (if supported).
  * @param  string  optional savepoint name
  * @return void
  */
 public function begin($savepoint = NULL)
 {
     $this->connected || $this->connect();
     $event = $this->onEvent ? new Event($this, Event::BEGIN, $savepoint) : NULL;
     try {
         $this->driver->begin($savepoint);
         $event && $this->onEvent($event->done());
     } catch (Exception $e) {
         $event && $this->onEvent($event->done($e));
         throw $e;
     }
 }