ITransactionFactory
A factory/IOC style container for creating ITransactions from IRunnable
Table of Contents
createTransactions() | Create a list of transactions for some list of runnables | \buffalokiwi\magicgraph\persist\ITransaction[] |
---|---|---|
execute() | Execute a bunch of transactions directly. | void |
executeAndTry() | Executes all transactions, then attempts to execute the code in $afterExecute. | void |
Methods
createTransactions()
Create a list of transactions for some list of runnables
public
createTransactions(
...$tasks :
IRunnable
)
: \buffalokiwi\magicgraph\persist\ITransaction[]
Parameters
- $tasks : IRunnable
tasks
Tags
Return values
\buffalokiwi\magicgraph\persist\ITransaction[] —transactions
execute()
Execute a bunch of transactions directly.
public
execute(
...$tasks :
IRunnable
)
: void
This wraps then with something like the ChainedTransactionManager and calls run().
Parameters
- $tasks : IRunnable
Tasks to run
executeAndTry()
Executes all transactions, then attempts to execute the code in $afterExecute.
public
executeAndTry(
$afterExecute :
Closure
, ...$tasks :
IRunnable
)
: void
If afterExecute throws an exception, then all transactions are rolled back.
Parameters
- $afterExecute : Closure
f() : void throws \Exception - Do this after execute, and before commit.
- $tasks : IRunnable
Tasks to execute