Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function execute(callable $function)
- {
- $transaction = \Yii::$app->db->beginTransaction();
- try {
- call_user_func($function);
- $transaction->commit();
- } catch (\Exception $e) {
- $transaction->rollBack();
- throw $e;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement