Exemplo n.º 1
0
 /**
  * Finds the Teaching model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id_subject
  * @param integer $id_teacher
  * @param integer $year
  * @return Teaching the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id_subject, $id_teacher, $year)
 {
     if (($model = Teaching::findOne(['id_subject' => $id_subject, 'id_teacher' => $id_teacher, 'year' => $year])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }