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
| void | __construct()
Create a new database transactions manager instance. | from DatabaseTransactionsManager |
| void | begin(string $connection, int $level)
Start a new database transaction. | from DatabaseTransactionsManager |
| array | commit(string $connection, int $levelBeingCommitted, int $newTransactionLevel)
Commit the root database transaction and execute callbacks. | from DatabaseTransactionsManager |
| void | stageTransactions(string $connection, int $levelBeingCommitted)
Move relevant pending transactions to a committed state. | from DatabaseTransactionsManager |
| void | rollback(string $connection, int $newTransactionLevel)
Rollback the active database transaction. | from DatabaseTransactionsManager |
| void | removeAllTransactionsForConnection(string $connection)
Remove all pending, completed, and current transactions for the given connection name. | from DatabaseTransactionsManager |
| void | removeCommittedTransactionsThatAreChildrenOf(DatabaseTransactionRecord $transaction)
Remove all transactions that are children of the given transaction. | from DatabaseTransactionsManager |
| 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. | from DatabaseTransactionsManager |
| Collection | getCommittedTransactions()
Get all of the committed transactions. | from DatabaseTransactionsManager |
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.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Foundation/Testing/DatabaseTransactionsManager.html