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 maxdbTransaction.php.
| __construct | ( | $ | connection | ) |
Constructor.
public
| mixed | $connection |
Definition at line 39 of file maxdbTransaction.php.
{
$this->objConnection = $connection;
//turn off autocommit
maxdb_autocommit( $this->objConnection, false );
}
| commit | ( | ) |
Commit transaction.
public
Definition at line 53 of file maxdbTransaction.php.
{
return maxdb_commit( $this->objConnection );
}
| rollback | ( | $ | savepoint = false |
) |
Rollback transaction.
public
| str | $savepoint |
Definition at line 65 of file maxdbTransaction.php.
{
if ( !$savepoint )
return maxdb_rollback( $this->objConnection );
else
return maxdb_query( $this->objConnection, 'ROLLBACK TO ' . $savepoint )
or trigger_error( maxdb_error( $this->objConnection ), E_USER_WARNING );
}
| savepoint | ( | $ | savepoint | ) |
Create rollback savepoint.
public
| str | $savepoint |
Definition at line 81 of file maxdbTransaction.php.
{
return maxdb_query( $this->objConnection, 'SAVEPOINT ' . $savepoint )
or trigger_error( maxdb_error( $this->objConnection ), E_USER_WARNING );
}
1.7.1