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