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