configName()
configName() : string
Get the configuration name for this connection.
This interface defines the methods you can depend on in a connection.
transactional(callable $transaction) : mixed
Executes a callable function inside a transaction, if any exception occurs while executing the passed callable, the transaction will be rolled back If the result of the callable function is `false`, the transaction will also be rolled back. Otherwise the transaction is committed after executing the callback.
The callback will receive the connection instance as its first argument.
callable | $transaction | The callback to execute within a transaction. |
Will re-throw any exception raised in $callback after rolling back the transaction.
The return value of the callback.
disableConstraints(callable $operation) : mixed
Run an operation with constraints disabled.
Constraints should be re-enabled after the callback succeeds/fails.
callable | $operation | The callback to execute within a transaction. |
Will re-throw any exception raised in $callback after rolling back the transaction.
The return value of the callback.
Loading…