Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
DatabaseTransactionsTrait Class Reference
+ Inheritance diagram for DatabaseTransactionsTrait:

Public Member Functions

 beginTransaction ()
 Initiates a transaction.
 
 commit ()
 Commits a transaction.
 
 commitToLevel ($transactionLevel)
 Commits nested transactions up to level $transactionLevel.
 
 commitAll ()
 Commits all nested transactions (up to level 0)
 
 rollBack ()
 Rolls back a transaction.
 
 rollBackToLevel ($transactionLevel)
 Rolls back nested transactions up to level $transactionLevel.
 
 rollBackAll ()
 Rolls back all nested transactions (up to level 0)
 
 inTransaction ()
 Checks if inside a transaction.
 
 callInTransaction ($callback,... $parameters)
 Call a callback with an array of parameters in a transaction.
 
 setIsolationLevel ($isolationLevel)
 Sets the isolation level for transactions.
 

Protected Member Functions

 nestable ()
 

Protected Attributes

 $transactionLevel = 0
 

Detailed Description

Definition at line 18 of file DatabaseTransactionsTrait.php.

Member Function Documentation

◆ beginTransaction()

beginTransaction ( )

Initiates a transaction.

Returns
boolean true on success or false on failure

Definition at line 30 of file DatabaseTransactionsTrait.php.

◆ callInTransaction()

callInTransaction (   $callback,
  $parameters 
)

Call a callback with an array of parameters in a transaction.

Parameters
callable$callback
mixed...$parameters
Exceptions

Exception

Returns
mixed

Definition at line 138 of file DatabaseTransactionsTrait.php.

◆ commit()

commit ( )

Commits a transaction.

Returns
boolean true on success or false on failure

Definition at line 48 of file DatabaseTransactionsTrait.php.

◆ commitAll()

commitAll ( )

Commits all nested transactions (up to level 0)

Returns
boolean true on success or false on failure

Definition at line 78 of file DatabaseTransactionsTrait.php.

◆ commitToLevel()

commitToLevel (   $transactionLevel)

Commits nested transactions up to level $transactionLevel.

Parameters
int$transactionLevel
Returns
boolean true on success or false on failure

Definition at line 65 of file DatabaseTransactionsTrait.php.

◆ inTransaction()

inTransaction ( )

Checks if inside a transaction.

Returns
boolean

Definition at line 126 of file DatabaseTransactionsTrait.php.

◆ nestable()

nestable ( )
protected

Definition at line 21 of file DatabaseTransactionsTrait.php.

◆ rollBack()

rollBack ( )

Rolls back a transaction.

Returns
boolean true on success or false on failure

Definition at line 87 of file DatabaseTransactionsTrait.php.

◆ rollBackAll()

rollBackAll ( )

Rolls back all nested transactions (up to level 0)

Returns
boolean true on success or false on failure

Definition at line 117 of file DatabaseTransactionsTrait.php.

◆ rollBackToLevel()

rollBackToLevel (   $transactionLevel)

Rolls back nested transactions up to level $transactionLevel.

Parameters
int$transactionLevel
Returns
boolean true on success or false on failure

Definition at line 104 of file DatabaseTransactionsTrait.php.

◆ setIsolationLevel()

setIsolationLevel (   $isolationLevel)

Sets the isolation level for transactions.

Parameters
$isolationLevel
Returns
mixed|void
Exceptions
DBException

Definition at line 166 of file DatabaseTransactionsTrait.php.

Field Documentation

◆ $transactionLevel

$transactionLevel = 0
protected

Definition at line 19 of file DatabaseTransactionsTrait.php.


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