/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Accessibility::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' => $this->id, 'road_mills' => $this->road_mills, 'road_town' => $this->road_town, 'mills_town' => $this->mills_town, 'bobot_road' => $this->bobot_road, 'bobot_mills' => $this->bobot_mills, 'bobot_town' => $this->bobot_town, 'cr' => $this->cr, 'validation' => $this->validation, 'id_user' => $this->id_user, 'date' => $this->date]); return $dataProvider; }
/** * Finds the Accessibility model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Accessibility the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Accessibility::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }