133
$model = $this->findModel($id);
$worker = WorkerController::findModel($model->id_worker);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
}
return $this->render('update', [
'model' => $model,
'worker' => $worker,
]);
}
/**
* Deletes an existing WorkTime model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
* @throws NotFoundHttpException if the model cannot be found
*/
public function actionDelete($id)
{
$model = $this->findModel($id);
$worker = WorkerController::findModel($model->id_worker);