public function executeTransaction(callable $callable)
    {
        try {
            $transaction = $this->beginTransaction();

            $return = $callable($this);

            if ($transaction) {
                $this->commit();
            }
        } catch (Exception $exception) {
            if ($transaction) {
                $this->rollBack();
            }

            throw $exception;
        }

        return $return;
    }
public function executeTransaction(callable $callable)
    {
        try {
            $transaction = $this->beginTransaction();

            $return = $callable($this);

            if ($transaction) {
                $this->commit();
            }
        } catch (Exception $exception) {
            if ($transaction) {
                $this->rollBack();
            }

            throw $exception;
        }

        return $return;
    }
public function executeTransaction ( callable $ callable ) { try { $ transaction = $ this -> beginTransaction ( ) ; $ return = $ callable ( $ this ) ; if ( $ transaction ) { $ this -> commit ( ) ; } } catch ( Exception $ exception ) { if ( $ transaction ) { $ this -> rollBack ( ) ; } throw $ exception ; } return $ return ; }
Execute a callable inside a transaction.

@return mixed The callable returned value
Execute a callable inside a transaction .