transaction() public method
Executes callback provided in a transaction.
public mixed transaction ( callable $callback, $isolationLevel = null ) | ||
---|---|---|
$callback | callable |
A valid PHP callback that performs the job. Accepts connection instance as parameter. |
$isolationLevel | string|null |
The isolation level to use for this transaction. See yii\db\Transaction::begin() for details. |
return | mixed |
Result of callback function |
throws | Exception |
Please login to continue.