/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Viewers::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'active' => $this->active, 'create_data' => $this->create_data, 'modified_dat' => $this->modified_dat]); $query->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'scales', $this->scales])->andFilterWhere(['like', 'init_extent', $this->init_extent])->andFilterWhere(['like', 'max_extent', $this->max_extent])->andFilterWhere(['like', 'projection', $this->projection])->andFilterWhere(['like', 'units', $this->units])->andFilterWhere(['like', 'author', $this->author])->andFilterWhere(['like', 'theme', $this->theme]); return $dataProvider; }