Public Member Functions

oracleTransaction Class Reference

Public Member Functions

 __construct ($connection)
 Constructor.
 commit ()
 Commit transaction.
 rollback ($savepoint=false)
 Rollback transaction.
 savepoint ($savepoint)
 Create rollback savepoint.

Detailed Description

Definition at line 15 of file oracleTransaction.php.


Constructor & Destructor Documentation

__construct ( connection  ) 

Constructor.

public

Parameters:
mixed $connection

Definition at line 39 of file oracleTransaction.php.

    {
        $this->objConnection = $connection;
    }


Member Function Documentation

commit (  ) 

Commit transaction.

public

Returns:
bool

Definition at line 50 of file oracleTransaction.php.

    {
        return oci_commit( $this->objConnection );
    }

rollback ( savepoint = false  ) 

Rollback transaction.

public

Parameters:
str $savepoint
Returns:
bool

Definition at line 62 of file oracleTransaction.php.

    {
        if ( !$savepoint )
        {
            return oci_rollback( $this->objConnection );
        }
        else
        {
            $objParse = oci_parse( $this->objConnection, 'ROLLBACK TO ' . $savepoint );

            if ( !$objParse )
            {
                $objError = oci_error( $this->objConnection );
                trigger_error( $objError['message'], E_USER_WARNING );
            }

            $objStmt = oci_execute( $objParse, OCI_DEFAULT );

            if ( !$objStmt )
            {
                $objError = oci_error( $objParse );
                trigger_error( $objError['message'], E_USER_WARNING );
            }

            return $objStmt;
        }
    }

savepoint ( savepoint  ) 

Create rollback savepoint.

public

Parameters:
str $savepoint
Returns:
bool

Definition at line 97 of file oracleTransaction.php.

    {
        $objParse = oci_parse( $this->objConnection, 'SAVEPOINT ' . $savepoint );

        if ( !$objParse )
        {
            $objError = oci_error( $this->objConnection );
            trigger_error( $objError['message'], E_USER_WARNING );
        }

        $objStmt = oci_execute( $objParse, OCI_DEFAULT );

        if ( !$objStmt )
        {
            $objError = oci_error( $this->objConnection );
            trigger_error( $objError['message'], E_USER_WARNING );
        }

        return $objStmt;
    }


The documentation for this class was generated from the following file: