コード例 #1
0
ファイル: NutricionSearch.php プロジェクト: krispaz/appsinsch
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Nutricion::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id_nut' => $this->id_nut, 'sub1_nut' => $this->sub1_nut, 'peso_en_kg_con_un_decimal______' => $this->peso_en_kg_con_un_decimal______, 'talla__cm_____' => $this->talla__cm_____, '_____no_tuvo_adelgazamiento__p_' => $this->_____no_tuvo_adelgazamiento__p_, '_____no_tuvo_sobrepeso__p_t___' => $this->_____no_tuvo_sobrepeso__p_t___, '_____no_baja_ganancia_de_peso__' => $this->_____no_baja_ganancia_de_peso__, '_____no_baja_ganancia_de_talla_' => $this->_____no_baja_ganancia_de_talla_, 'pro_nut' => $this->pro_nut]);
     return $dataProvider;
 }
コード例 #2
0
 /**
  * Finds the Nutricion model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Nutricion the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Nutricion::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }