/**
  * Finds the DctSolidFood model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return DctSolidFood the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     $model = DctSolidFood::find()->with('dctSolidFoodLocs')->where(['dct_solid_food_id' => $id])->one();
     if ($model !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
示例#2
0
 /**
  * Lists all Diary models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Diary::find()]);
     $solidFood = DctSolidFood::find()->select('`dct_solid_food`.*, `dct_solid_food_loc`.`text` as text')->leftJoin('dct_solid_food_loc', '`dct_solid_food_loc`.`dct_solid_food_id` = `dct_solid_food`.`dct_solid_food_id`')->where(['dct_solid_food_loc.dct_language_id' => $this->currentLngId])->with('dctSolidFoodLocs')->asArray()->all();
     return $this->render('index', ['dataProvider' => $dataProvider, 'solidFood' => $solidFood]);
 }
 /**
  * Lists all DctSolidFood models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => DctSolidFood::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }