DBTransaction Class Reference

Class representing a transaction on a database. More...

Inheritance diagram for DBTransaction:

Inheritance graph
[legend]

List of all members.

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.


Detailed Description

Class representing a transaction on a database.

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


Member Function Documentation

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.

Parameters:
$name [string]: name of method
$args [array]: arguments to method
Returns:
[mixed]: whatever the DBI2 method returns, or false if an invalid method was called

DBTransaction::addCallback ( cb  ) 

Adds callback to be called when transaction completes.

See DBI2::addTransactionCallback() for more information

Parameters:
$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.


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

Generated on Wed Nov 24 02:02:20 2010 for Common by  doxygen 1.5.6