lib/ezdb/classes/ezdbinterface.php
function begin()
    {
        $ini = eZINI::instance();
        if ($ini->variable( "DatabaseSettings", "Transactions" ) == "enabled")
        {
            if ( $this->TransactionCounter > 0 )
            {
                if ( is_array( $this->TransactionStackTree ) )
                {
                    // Make a new sub-level for debugging
                    $bt = debug_backtrace();
                    $subLevels =& $this->TransactionStackTree['sub_levels'];
                    for ( $i = 1; $i < $this->TransactionCounter; ++$i )
                    {
                        $subLevels =& $subLevels[count( $subLevels ) - 1]['sub_levels'];
                    }
                    // Next entry will be at the end
                    $subLevels[count( $subLevels )] = array( 'level' => $this->TransactionCounter,
                                                             'trace' => $bt,
                                                             'sub_levels' => array() );
                }
                ++$this->TransactionCounter;
                return false;
            }
            else
            {
                if ( is_array( $this->TransactionStackTree ) )
                {
                    // Start new stack tree for debugging
                    $bt = debug_backtrace();
                    $this->TransactionStackTree = array( 'level' => $this->TransactionCounter,
                                                         'trace' => $bt,
                                                         'sub_levels' => array() );
                }
            }
            $this->TransactionIsValid = true;

            if ( $this->isConnected() )
            {
                $oldRecordError = $this->RecordError;
                // Turn off error handling while we begin
                $this->RecordError = false;
                $this->beginQuery();
                $this->RecordError = $oldRecordError;

                // We update the transaction counter after the query, otherwise we
                // mess up the debug background highlighting.
                ++$this->TransactionCounter;
            }
        }
        return true;
    }
function begin()
    {
        $ini = eZINI::instance();
        if ($ini->variable( "DatabaseSettings", "Transactions" ) == "enabled")
        {
            if ( $this->TransactionCounter > 0 )
            {
                if ( is_array( $this->TransactionStackTree ) )
                {
                    // Make a new sub-level for debugging
                    $bt = debug_backtrace();
                    $subLevels =& $this->TransactionStackTree['sub_levels'];
                    for ( $i = 1; $i < $this->TransactionCounter; ++$i )
                    {
                        $subLevels =& $subLevels[count( $subLevels ) - 1]['sub_levels'];
                    }
                    // Next entry will be at the end
                    $subLevels[count( $subLevels )] = array( 'level' => $this->TransactionCounter,
                                                             'trace' => $bt,
                                                             'sub_levels' => array() );
                }
                ++$this->TransactionCounter;
                return false;
            }
            else
            {
                if ( is_array( $this->TransactionStackTree ) )
                {
                    // Start new stack tree for debugging
                    $bt = debug_backtrace();
                    $this->TransactionStackTree = array( 'level' => $this->TransactionCounter,
                                                         'trace' => $bt,
                                                         'sub_levels' => array() );
                }
            }
            $this->TransactionIsValid = true;

            if ( $this->isConnected() )
            {
                $oldRecordError = $this->RecordError;
                // Turn off error handling while we begin
                $this->RecordError = false;
                $this->beginQuery();
                $this->RecordError = $oldRecordError;

                // We update the transaction counter after the query, otherwise we
                // mess up the debug background highlighting.
                ++$this->TransactionCounter;
            }
        }
        return true;
    }
function begin ( ) { $ ini = eZINI :: instance ( ) ; if ( $ ini -> variable ( "DatabaseSettings" , "Transactions" ) == "enabled" ) { if ( $ this -> TransactionCounter > 0 ) { if ( is_array ( $ this -> TransactionStackTree ) ) { // Make a new sub-level for debugging $ bt = debug_backtrace ( ) ; $ subLevels = & $ this -> TransactionStackTree [ 'sub_levels' ] ; for ( $ i = 1 ; $ i < $ this -> TransactionCounter ; ++ $ i ) { $ subLevels = & $ subLevels [ count ( $ subLevels ) - 1 ] [ 'sub_levels' ] ; } // Next entry will be at the end $ subLevels [ count ( $ subLevels ) ] = array ( 'level' => $ this -> TransactionCounter , 'trace' => $ bt , 'sub_levels' => array ( ) ) ; } ++ $ this -> TransactionCounter ; return false ; } else { if ( is_array ( $ this -> TransactionStackTree ) ) { // Start new stack tree for debugging $ bt = debug_backtrace ( ) ; $ this -> TransactionStackTree = array ( 'level' => $ this -> TransactionCounter , 'trace' => $ bt , 'sub_levels' => array ( ) ) ; } } $ this -> TransactionIsValid = true ; if ( $ this -> isConnected ( ) ) { $ oldRecordError = $ this -> RecordError ; // Turn off error handling while we begin $ this -> RecordError = false ; $ this -> beginQuery ( ) ; $ this -> RecordError = $ oldRecordError ; // We update the transaction counter after the query, otherwise we // mess up the debug background highlighting. ++ $ this -> TransactionCounter ; } } return true ; }
Begin a new transaction.

If we are already in transaction then we omit this new transaction and its matching commit or rollback.

@return bool
Begin a new transaction .