Public Member Functions | |
__construct ($connection) | |
Constructor. | |
commit () | |
Commit transaction. | |
rollback ($savepoint=false) | |
Rollback transaction. | |
savepoint ($savepoint) | |
Create rollback savepoint. |
Definition at line 15 of file pgsqlTransaction.php.
__construct | ( | $ | connection | ) |
Constructor.
public
mixed | $connection |
Definition at line 39 of file pgsqlTransaction.php.
{ $this->objConnection = $connection; //turn off autocommit pg_query( $this->objConnection, 'BEGIN' ) or trigger_error( pg_last_error( $this->objConnection ), E_USER_WARNING ); }
commit | ( | ) |
Commit transaction.
public
Definition at line 54 of file pgsqlTransaction.php.
{ return pg_query( $this->objConnection, 'COMMIT' ) or trigger_error( pg_last_error( $this->objConnection ), E_USER_WARNING ); }
rollback | ( | $ | savepoint = false |
) |
Rollback transaction.
public
str | $savepoint |
Definition at line 67 of file pgsqlTransaction.php.
{ if ( !$savepoint ) return pg_query( $this->objConnection, 'ROLLBACK' ) or trigger_error( pg_last_error( $this->objConnection ), E_USER_WARNING ); else return pg_query( $this->objConnection, 'ROLLBACK TO SAVEPOINT ' . $savepoint ) or trigger_error( pg_last_error( $this->objConnection ), E_USER_WARNING ); }
savepoint | ( | $ | savepoint | ) |
Create rollback savepoint.
public
str | $savepoint |
Definition at line 84 of file pgsqlTransaction.php.
{ return pg_query( $this->objConnection, 'SAVEPOINT ' . $savepoint ) or trigger_error( pg_last_error( $this->objConnection ), E_USER_WARNING ); }