Delegated transaction class.
More...
Delegated transaction class.
- Copyright
- 2009 Petr Skoda (http://skodak.org)
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
moodle_transaction::__construct |
( |
|
$database | ) |
|
Delegated transaction constructor, can be called only from moodle_database class.
Unfortunately PHP's protected keyword is useless.
- Parameters
-
◆ allow_commit()
moodle_transaction::allow_commit |
( |
| ) |
|
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.
- Return values
-
◆ dispose()
moodle_transaction::dispose |
( |
| ) |
|
Mark transaction as disposed, no more commits and rollbacks allowed.
To be used only from moodle_database class
- Return values
-
◆ get_backtrace()
moodle_transaction::get_backtrace |
( |
| ) |
|
Returns backtrace of the code starting exception.
- Return values
-
◆ is_disposed()
moodle_transaction::is_disposed |
( |
| ) |
|
Is the delegated transaction already used?
- Return values
-
bool | true if commit and rollback allowed, false if already done |
◆ rollback()
moodle_transaction::rollback |
( |
|
$e | ) |
|
Rollback all current delegated transactions.
- Parameters
-
Exception | Throwable | $e | mandatory exception/throwable |
- Return values
-
The documentation for this class was generated from the following file: