DatabaseTransactionsManager
class DatabaseTransactionsManager extends DatabaseTransactionsManager (View source)
Properties
protected DatabaseTransactionRecord> | $committedTransactions | All of the committed transactions. |
from DatabaseTransactionsManager |
protected DatabaseTransactionRecord> | $pendingTransactions | All of the pending transactions. |
from DatabaseTransactionsManager |
protected array | $currentTransaction | The current transaction. |
from DatabaseTransactionsManager |
Methods
Create a new database transactions manager instance.
Start a new database transaction.
Commit the root database transaction and execute callbacks.
Move relevant pending transactions to a committed state.
Rollback the active database transaction.
Remove all pending, completed, and current transactions for the given connection name.
Remove all transactions that are children of the given transaction.
Register a transaction callback.
Get the transactions that are applicable to callbacks.
Determine if after commit callbacks should be executed for the given transaction level.
Get all of the pending transactions.
Get all of the committed transactions.
Details
void
__construct()
Create a new database transactions manager instance.
void
begin(string $connection, int $level)
Start a new database transaction.
array
commit(string $connection, int $levelBeingCommitted, int $newTransactionLevel)
Commit the root database transaction and execute callbacks.
void
stageTransactions(string $connection, int $levelBeingCommitted)
Move relevant pending transactions to a committed state.
void
rollback(string $connection, int $newTransactionLevel)
Rollback the active database transaction.
protected void
removeAllTransactionsForConnection(string $connection)
Remove all pending, completed, and current transactions for the given connection name.
protected void
removeCommittedTransactionsThatAreChildrenOf(DatabaseTransactionRecord $transaction)
Remove all transactions that are children of the given transaction.
void
addCallback(callable $callback)
Register a transaction callback.
DatabaseTransactionRecord>
callbackApplicableTransactions()
Get the transactions that are applicable to callbacks.
bool
afterCommitCallbacksShouldBeExecuted(int $level)
Determine if after commit callbacks should be executed for the given transaction level.
Collection
getPendingTransactions()
Get all of the pending transactions.
Collection
getCommittedTransactions()
Get all of the committed transactions.