Exemplo n.º 1
0
 /**
  * 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();
 }
Exemplo n.º 2
0
 /**
  * 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]);
     }
 }