ManagesTransactions (Database\Concerns)

ManagesTransactions

trait ManagesTransactions (View source)

Methods

mixed transaction(Closure $callback, int $attempts = 1)

Execute a Closure within a transaction.

void beginTransaction()

Start a new database transaction.

void commit()

Commit the active database transaction.

void rollBack(int|null $toLevel = null)

Rollback the active database transaction.

int transactionLevel()

Get the number of active transactions.

Details

mixed transaction(Closure $callback, int $attempts = 1)

Execute a Closure within a transaction.

Parameters

Closure $callback
int $attempts

Return Value

mixed

Exceptions

Throwable

void beginTransaction()

Start a new database transaction.

Return Value

void

Exceptions

Exception

void commit()

Commit the active database transaction.

Return Value

void

void rollBack(int|null $toLevel = null)

Rollback the active database transaction.

Parameters

int|null $toLevel

Return Value

void

int transactionLevel()

Get the number of active transactions.

Return Value

int

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.4/Illuminate/Database/Concerns/ManagesTransactions.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部