127
* @param integer $id
* @return mixed
* @throws NotFoundHttpException if the model cannot be found
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the Worker model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Worker the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
public static function findModel($id)
{
if (($model = Worker::findOne($id)) !== null) {
return $model;
}