/** * Execute the job. * * @return bool */ public function handle() { $this->record->status = $this->record->input('status', $this->record->status); $this->record->title = $this->request->input('title', $this->record->title); $this->record->description = $this->request->input('description', $this->record->description); return $this->record->save(); }
/** * Creates a new ServiceRecord model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new ServiceRecord(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->service_id]); } else { return $this->render('create', ['model' => $model]); } }