コード例 #1
0
 /**
  * Begins a transaction (if supported).
  * @param  string  optional savepoint name
  * @return void
  */
 public function begin($savepoint = NULL)
 {
     $this->connected || $this->connect();
     if ($this->profiler !== NULL) {
         $ticket = $this->profiler->before($this, IDibiProfiler::BEGIN, $savepoint);
     }
     $this->driver->begin($savepoint);
     if (isset($ticket)) {
         $this->profiler->after($ticket);
     }
 }
コード例 #2
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 DibiEvent($this, DibiEvent::BEGIN, $savepoint) : NULL;
     try {
         $this->driver->begin($savepoint);
         $event && $this->onEvent($event->done());
     } catch (DibiException $e) {
         $event && $this->onEvent($event->done($e));
         throw $e;
     }
 }