/**
  * Updates an existing TaskDefined model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     $modelDevice = new Device();
     $modelAction = new Action();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         //return $this->redirect(['view', 'id' => $model->id]);
         return $this->redirect(['task/index']);
     } else {
         return $this->render('update', ['model' => $model, 'from_device_ids' => ArrayHelper::map($modelDevice->getDeviceMaster(), 'id', 'name'), 'to_device_ids' => ArrayHelper::map($modelDevice->getDeviceAll(), 'id', 'name'), 'action_ids' => ArrayHelper::map($modelAction->getActionAll(), 'id', 'name')]);
     }
 }