Guest User

Untitled

a guest
Oct 19th, 2019
128
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function execute(callable $function)
  2. {
  3. $transaction = \Yii::$app->db->beginTransaction();
  4. try {
  5. call_user_func($function);
  6. $transaction->commit();
  7. } catch (\Exception $e) {
  8. $transaction->rollBack();
  9. throw $e;
  10. }
  11. }
RAW Paste Data