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 sqlite3Transaction.php.
| __construct | ( | $ | connection | ) |
Constructor.
public
| mixed | $connection |
Definition at line 39 of file sqlite3Transaction.php.
{
$this->objConnection = $connection;
//turn off autocommit
$this->objConnection->query( 'BEGIN' )
or trigger_error( $this->objConnection->lastErrorMsg(), E_USER_WARNING );
}
| commit | ( | ) |
Commit transaction.
public
Definition at line 54 of file sqlite3Transaction.php.
{
return $this->objConnection->query( 'COMMIT' )
or trigger_error( $this->objConnection->lastErrorMsg(), E_USER_WARNING );
}
| rollback | ( | $ | savepoint = false |
) |
Rollback transaction.
public
Definition at line 66 of file sqlite3Transaction.php.
{
if ( !$savepoint )
return $this->objConnection->query( 'ROLLBACK' )
or trigger_error( $this->objConnection->lastErrorMsg(), E_USER_WARNING );
else
return $this->objConnection->query( 'ROLLBACK TO ' . $savepoint )
or trigger_error( $this->objConnection->lastErrorMsg(), E_USER_WARNING );
}
| savepoint | ( | $ | savepoint | ) |
Create rollback savepoint.
public
Definition at line 82 of file sqlite3Transaction.php.
{
return $this->objConnection->query( 'SAVEPOINT ' . $savepoint )
or trigger_error( $this->objConnection->lastErrorMsg(), E_USER_WARNING );
}
1.7.1