/** * Finds the Anc model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $HOSPCODE * @param string $PID * @param string $DATE_SERV * @return Anc the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($HOSPCODE, $PID, $DATE_SERV) { if (($model = Anc::findOne(['HOSPCODE' => $HOSPCODE, 'PID' => $PID, 'DATE_SERV' => $DATE_SERV])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }