TransactionManager
interface TransactionManager
Represents an object that is capable of controlling transactions.
The TransactionManager might be the database connection itself, calling queries to orchestrate transactions, or a connector such as the PDOConnector.
Generally speaking you should rely on your Database object to manage the creation of a TansactionManager for you; unless you are building new database connectors this should be treated as an internal API.
Methods
Start a prepared transaction
Complete a transaction
Roll-back a transaction
Create a new savepoint
Return the depth of the transaction For unnested transactions returns 1 while in a transaction, 0 otherwise
Return true if savepoints are supported by this transaction manager.
Details
at line 24
bool
transactionStart(string|boolean $transactionMode = false, string|boolean $sessionCharacteristics = false)
Start a prepared transaction
at line 32
bool
transactionEnd()
Complete a transaction
at line 41
bool
transactionRollback(string $savepoint = null)
Roll-back a transaction
at line 49
transactionSavepoint(string $savepoint)
Create a new savepoint
at line 57
int
transactionDepth()
Return the depth of the transaction For unnested transactions returns 1 while in a transaction, 0 otherwise
at line 66
boolean
supportsSavepoints()
Return true if savepoints are supported by this transaction manager.
Savepoints aren't supported by all database connectors (notably PDO doesn't support them) and should be used with caution.