public function transaction(\Closure $callback) { try { $this->begin(); $return = $callback(); $this->commit(); return $return; } catch (\Exception $e) { $this->rollback(); throw $e; } }
/** * @param \Closure $callback * @return mixed */ protected final function transaction(\Closure $callback) { try { return $this->transaction->transaction($callback); } catch (\Exception $e) { $this->handleException($e); throw $e; } }