/** * Commits statements in a transaction. * @param string optional savepoint name * @return void */ public function commit($savepoint = NULL) { $this->connected || $this->connect(); $event = $this->onEvent ? new Event($this, Event::COMMIT, $savepoint) : NULL; try { $this->driver->commit($savepoint); $event && $this->onEvent($event->done()); } catch (Exception $e) { $event && $this->onEvent($event->done($e)); throw $e; } }