Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
DAOTransactionsTrait.php
Go to the documentation of this file.
1<?php
2
3namespace Ubiquity\orm\traits;
4
16
17 abstract public static function getDatabase($offset = 'default');
18
25 public static function beginTransaction($offset = 'default') {
26 self::getDatabase ( $offset )->beginTransaction ();
27 }
28
35 public static function commit($offset = 'default') {
36 return self::getDatabase ( $offset )->commit ();
37 }
38
46 public static function commitToLevel($transactionLevel, $offset = 'default') {
47 return self::getDatabase ( $offset )->commitToLevel ( $transactionLevel );
48 }
49
57 public static function commitAll($offset = 'default') {
58 return self::getDatabase ( $offset )->commitAll ();
59 }
60
67 public static function rollBack($offset = 'default') {
68 return self::getDatabase ( $offset )->rollBack ();
69 }
70
78 public static function rollBackToLevel($transactionLevel, $offset = 'default') {
79 return self::getDatabase ( $offset )->rollBackToLevel ( $transactionLevel );
80 }
81
88 public static function rollBackAll($offset = 'default') {
89 return self::getDatabase ( $offset )->rollBackAll ();
90 }
91
101 public static function callInTransaction($callback, $offset, ...$parameters) {
102 return self::getDatabase ( $offset )->callInTransaction ( $callback, $offset, ...$parameters );
103 }
104
111 public static function setIsolationLevel(string $offset='default',$isolationLevel='READ COMMITTED') {
112 return self::getDatabase($offset)->setIsolationLevel($isolationLevel);
113 }
114}
115
static rollBack($offset='default')
Rolls back a transaction.
static commit($offset='default')
Commits a transaction.
static beginTransaction($offset='default')
Initiates a transaction.
static rollBackAll($offset='default')
Rolls back all nested transactions (up to level 0)
static commitAll($offset='default')
Commits all nested transactions (up to level 0)
static getDatabase($offset='default')
static setIsolationLevel(string $offset='default', $isolationLevel='READ COMMITTED')
Sets the isolation level for transactions.
static commitToLevel($transactionLevel, $offset='default')
Commits nested transactions up to level $transactionLevel.
static callInTransaction($callback, $offset,... $parameters)
Call a callback with an array of parameters in a transaction.
static rollBackToLevel($transactionLevel, $offset='default')
Rolls back nested transactions up to level $transactionLevel.
Ubiquity\orm\traits This class is part of Ubiquity.