public function rollback($toBeginning = null)
    {
        if (!$this->_transactionStarted) {
            return false;
        }

        $useSavePoint = $this->isSavePointsEnabled();
        if ($toBeginning === null) {
            $toBeginning = !$useSavePoint;
        }
        if ($this->_transactionLevel === 0 || $toBeginning) {
            $this->_transactionLevel = 0;
            $this->_transactionStarted = false;
            $this->nestedTransactionRollbackException = null;
            if ($this->_logQueries) {
                $this->log('ROLLBACK');
            }
            $this->_driver->rollbackTransaction();

            return true;
        }

        $savePoint = $this->_transactionLevel--;
        if ($useSavePoint) {
            $this->rollbackSavepoint($savePoint);
        } elseif ($this->nestedTransactionRollbackException === null) {
            $this->nestedTransactionRollbackException = new NestedTransactionRollbackException();
        }

        return true;
    }
public function rollback($toBeginning = null)
    {
        if (!$this->_transactionStarted) {
            return false;
        }

        $useSavePoint = $this->isSavePointsEnabled();
        if ($toBeginning === null) {
            $toBeginning = !$useSavePoint;
        }
        if ($this->_transactionLevel === 0 || $toBeginning) {
            $this->_transactionLevel = 0;
            $this->_transactionStarted = false;
            $this->nestedTransactionRollbackException = null;
            if ($this->_logQueries) {
                $this->log('ROLLBACK');
            }
            $this->_driver->rollbackTransaction();

            return true;
        }

        $savePoint = $this->_transactionLevel--;
        if ($useSavePoint) {
            $this->rollbackSavepoint($savePoint);
        } elseif ($this->nestedTransactionRollbackException === null) {
            $this->nestedTransactionRollbackException = new NestedTransactionRollbackException();
        }

        return true;
    }
public function rollback ( $ toBeginning = null ) { if ( ! $ this -> _transactionStarted ) { return false ; } $ useSavePoint = $ this -> isSavePointsEnabled ( ) ; if ( $ toBeginning === null ) { $ toBeginning = ! $ useSavePoint ; } if ( $ this -> _transactionLevel === 0 || $ toBeginning ) { $ this -> _transactionLevel = 0 ; $ this -> _transactionStarted = false ; $ this -> nestedTransactionRollbackException = null ; if ( $ this -> _logQueries ) { $ this -> log ( 'ROLLBACK' ) ; } $ this -> _driver -> rollbackTransaction ( ) ; return true ; } $ savePoint = $ this -> _transactionLevel -- ; if ( $ useSavePoint ) { $ this -> rollbackSavepoint ( $ savePoint ) ; } elseif ( $ this -> nestedTransactionRollbackException === null ) { $ this -> nestedTransactionRollbackException = new NestedTransactionRollbackException ( ) ; } return true ; }
Rollback current transaction.

@param bool|null $toBeginning Whether or not the transaction should be rolled back to the
beginning of it. Defaults to false if using savepoints, or true if not.
@return bool
Rollback current transaction .