/** * Finds the DctVaccination model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return DctVaccination the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { $model = DctVaccination::find()->with('dctVaccinationLocs')->where(['dct_vaccination_id' => $id])->one(); if ($model !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getDctVaccination() { return $this->hasOne(DctVaccination::className(), ['dct_vaccination_id' => 'dct_vaccination_id']); }
/** * Finds the DctVaccination model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return DctVaccination the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = DctVaccination::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }