ManagesTransactions
Table of Contents
- beginTransaction() : void
- Start a new database transaction.
- commit() : void
- Commit the active database transaction.
- rollBack() : void
- Rollback the active database transaction.
- transaction() : mixed
- Execute a Closure within a transaction.
- transactionLevel() : int
- Get the number of active transactions.
- createSavepoint() : void
- Create a save point within the database.
- createTransaction() : void
- Create a transaction within the database.
- handleBeginTransactionException() : void
- Handle an exception from a transaction beginning.
- handleTransactionException() : void
- Handle an exception encountered when running a transacted statement.
- performRollBack() : void
- Perform a rollback within the database.
Methods
beginTransaction()
Start a new database transaction.
public
beginTransaction() : void
Tags
Return values
void —commit()
Commit the active database transaction.
public
commit() : void
Return values
void —rollBack()
Rollback the active database transaction.
public
rollBack([int|null $toLevel = null ]) : void
Parameters
- $toLevel : int|null = null
Return values
void —transaction()
Execute a Closure within a transaction.
public
transaction(Closure $callback[, int $attempts = 1 ]) : mixed
Parameters
- $callback : Closure
- $attempts : int = 1
Tags
Return values
mixed —transactionLevel()
Get the number of active transactions.
public
transactionLevel() : int
Return values
int —createSavepoint()
Create a save point within the database.
protected
createSavepoint() : void
Return values
void —createTransaction()
Create a transaction within the database.
protected
createTransaction() : void
Return values
void —handleBeginTransactionException()
Handle an exception from a transaction beginning.
protected
handleBeginTransactionException(Exception $e) : void
Parameters
- $e : Exception
Tags
Return values
void —handleTransactionException()
Handle an exception encountered when running a transacted statement.
protected
handleTransactionException(Exception $e, int $currentAttempt, int $maxAttempts) : void
Parameters
- $e : Exception
- $currentAttempt : int
- $maxAttempts : int
Tags
Return values
void —performRollBack()
Perform a rollback within the database.
protected
performRollBack(int $toLevel) : void
Parameters
- $toLevel : int