original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Rollback current transaction .