Moodle  2.2.1
http://www.collinsharper.com
moodle_transaction Class Reference

Public Member Functions

 __construct ($database)
 get_backtrace ()
 is_disposed ()
 dispose ()
 allow_commit ()
 rollback (Exception $e)

Detailed Description

Delegated transaction class.

Definition at line 33 of file moodle_transaction.php.


Constructor & Destructor Documentation

__construct ( database)

Delegated transaction constructor, can be called only from moodle_database class. Unfortunately PHP's protected keyword is useless.

Parameters:
moodle_database$database

Definition at line 43 of file moodle_transaction.php.


Member Function Documentation

Commit delegated transaction. The real database commit SQL is executed only after committing all delegated transactions.

Incorrect order of nested commits or rollback at any level is resulting in rollback of SQL transaction.

Returns:
void

Definition at line 85 of file moodle_transaction.php.

Here is the call graph for this function:

dispose ( )

Mark transaction as disposed, no more commits and rollbacks allowed. To be used only from moodle_database class

Returns:
unknown_type

Definition at line 71 of file moodle_transaction.php.

Here is the caller graph for this function:

Returns backtrace of the code starting exception.

Returns:
array

Definition at line 53 of file moodle_transaction.php.

Is the delegated transaction already used?

Returns:
bool true if commit and rollback allowed, false if already done

Definition at line 61 of file moodle_transaction.php.

Here is the caller graph for this function:

rollback ( Exception $  e)

Rollback all current delegated transactions.

Parameters:
Exception$emandatory exception
Returns:
void

Definition at line 98 of file moodle_transaction.php.

Here is the call graph for this function:


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations