Dibi\Connection::begin PHP Méthode

begin() public méthode

Begins a transaction (if supported).
public begin ( $savepoint = NULL ) : void
Résultat 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;
        }
    }

Usage Example

 public final function run()
 {
     $this->dibiConnection->begin();
     try {
         parent::run();
     } catch (\Exception $e) {
         $this->dibiConnection->rollback();
         throw $e;
     }
     $this->dibiConnection->commit();
 }
All Usage Examples Of Dibi\Connection::begin