DatabaseTransactionsManager

class DatabaseTransactionsManager (View source)

Properties

protected Collection $transactions

All of the recorded transactions.

protected DatabaseTransactionRecord $callbacksShouldIgnore

The database transaction that should be ignored by callbacks.

Methods

void __construct()

Create a new database transactions manager instance.

void begin(string $connection, int $level)

Start a new database transaction.

void rollback(string $connection, int $level)

Rollback the active database transaction.

void commit(string $connection)

Commit the active database transaction.

void addCallback(callable $callback)

Register a transaction callback.

$this callbacksShouldIgnore(DatabaseTransactionRecord $transaction)

Specify that callbacks should ignore the given transaction when determining if they should be executed.

Collection callbackApplicableTransactions()

Get the transactions that are applicable to callbacks.

Collection getTransactions()

Get all the 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

void rollback(string $connection, int $level)

Rollback the active database transaction.

Parameters

string $connection
int $level

Return Value

void

void commit(string $connection)

Commit the active database transaction.

Parameters

string $connection

Return Value

void

void addCallback(callable $callback)

Register a transaction callback.

Parameters

callable $callback

Return Value

void

$this callbacksShouldIgnore(DatabaseTransactionRecord $transaction)

Specify that callbacks should ignore the given transaction when determining if they should be executed.

Parameters

DatabaseTransactionRecord $transaction

Return Value

$this

Collection callbackApplicableTransactions()

Get the transactions that are applicable to callbacks.

Return Value

Collection

Collection getTransactions()

Get all the transactions.

Return Value

Collection

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/9.x/Illuminate/Database/DatabaseTransactionsManager.html