Public Member Functions | |
__call ($name, $args) | |
Forwards the five DBI2 methods to the DBI2 object. | |
addCallback ($cb) | |
Adds callback to be called when transaction completes. | |
cancel () | |
Cancels the transaction. | |
commit () | |
Commits the transaction. |
This class is created by the DBI2::reateTransaction() method. It represent a single, hopefully non-nested transaction. You can call query(), select(), insert(), update() and delete() on it, which function exactly the same as the DBI2 counterparts. When the transaction is finished, call commit() or cancel() to commit or cancel the transaction, respectively. If you do not commit or cancel, the transaction will be automatically cancelled when the transaction object goes out of scope or is to be garbage collected. This prevents locked database connections
DBTransaction::__call | ( | $ | name, | |
$ | args | |||
) |
Forwards the five DBI2 methods to the DBI2 object.
This is what allows you to call query(), et al. on this transaction object. Those methods have the same arguments on this object as they do on DBI2.
$name | [string]: name of method | |
$args | [array]: arguments to method |
DBTransaction::addCallback | ( | $ | cb | ) |
Adds callback to be called when transaction completes.
See DBI2::addTransactionCallback() for more information
$cb | [callback]: callback function |
DBTransaction::cancel | ( | ) |
Cancels the transaction.
See DBI2::cancelTransaction() for more information
DBTransaction::commit | ( | ) |
Commits the transaction.
See DBI2::commitTransaction() for more information.