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

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.

void
removeAllTransactionsForConnection(string $connection)

Remove all pending, completed, and current transactions for the given connection name.

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.

getPendingTransactions()

Get all of the pending transactions.

getCommittedTransactions()

Get all of the committed transactions.

Details

void __construct()

Create a new database transactions manager instance.

Return Value

void

void begin(string $connection, int $level)

Start a new database transaction.

Parameters

string $connection
int $level

Return Value

void

array commit(string $connection, int $levelBeingCommitted, int $newTransactionLevel)

Commit the root database transaction and execute callbacks.

Parameters

string $connection
int $levelBeingCommitted
int $newTransactionLevel

Return Value

array

void stageTransactions(string $connection, int $levelBeingCommitted)

Move relevant pending transactions to a committed state.

Parameters

string $connection
int $levelBeingCommitted

Return Value

void

void rollback(string $connection, int $newTransactionLevel)

Rollback the active database transaction.

Parameters

string $connection
int $newTransactionLevel

Return Value

void

protected void removeAllTransactionsForConnection(string $connection)

Remove all pending, completed, and current transactions for the given connection name.

Parameters

string $connection

Return Value

void

protected void removeCommittedTransactionsThatAreChildrenOf(DatabaseTransactionRecord $transaction)

Remove all transactions that are children of the given transaction.

Parameters

DatabaseTransactionRecord $transaction

Return Value

void

void addCallback(callable $callback)

Register a transaction callback.

Parameters

callable $callback

Return Value

void

DatabaseTransactionRecord> callbackApplicableTransactions()

Get the transactions that are applicable to callbacks.

Return Value

DatabaseTransactionRecord>

bool afterCommitCallbacksShouldBeExecuted(int $level)

Determine if after commit callbacks should be executed for the given transaction level.

Parameters

int $level

Return Value

bool

Collection getPendingTransactions()

Get all of the pending transactions.

Return Value

Collection

Collection getCommittedTransactions()

Get all of the committed transactions.

Return Value

Collection