Пример #1
0
 public function trans($id, $param = [])
 {
     $customer = Doing::findOne($id);
     $res = Doing::getDb()->transaction(function ($db) use($customer, $param) {
         $customer->email = $param['email'];
         $customer->save();
         return $customer;
     });
     return $res;
 }
Пример #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDoing()
 {
     return $this->hasMany(Doing::className(), ['id_name' => 'id']);
 }
Пример #3
0
 public function actionTestDoing()
 {
     $doing = Doing::findOne(2);
     return $this->render('test-doing', ['doing' => $doing]);
 }