SHARE
TWEET

Untitled

a guest Oct 19th, 2019 87 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top