public function transaction($callback)
    {
        $connection = $this->getConnection();
        $connection->beginTransaction();

        if ($callback instanceof Closure) {
            $callback = $callback->bindTo($this, get_class($this));
        }

        if (call_user_func($callback, $this) === false) {
            $connection->rollBack();
        } else {
            $connection->commit();
        }

        return $this;
    }
public function transaction($callback)
    {
        $connection = $this->getConnection();
        $connection->beginTransaction();

        if ($callback instanceof Closure) {
            $callback = $callback->bindTo($this, get_class($this));
        }

        if (call_user_func($callback, $this) === false) {
            $connection->rollBack();
        } else {
            $connection->commit();
        }

        return $this;
    }
public function transaction ( $ callback ) { $ connection = $ this -> getConnection ( ) ; $ connection -> beginTransaction ( ) ; if ( $ callback instanceof Closure ) { $ callback = $ callback -> bindTo ( $ this , get_class ( $ this ) ) ; } if ( call_user_func ( $ callback , $ this ) === false ) { $ connection -> rollBack ( ) ; } else { $ connection -> commit ( ) ; } return $ this ; }
Sets up a transaction call

@param *callable $callback

@return AbstractSql
Sets up a transaction call