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