/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = REFERRALS::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['REFERRAL_ID' => $this->REFERRAL_ID]); $query->andFilterWhere(['like', 'REFERRAL_NAME', $this->REFERRAL_NAME])->andFilterWhere(['like', 'ADDRESS', $this->ADDRESS])->andFilterWhere(['like', 'CITY', $this->CITY])->andFilterWhere(['like', 'STATE', $this->STATE])->andFilterWhere(['like', 'ZIP', $this->ZIP])->andFilterWhere(['like', 'EMAIL', $this->EMAIL])->andFilterWhere(['like', 'PHONE', $this->PHONE])->andFilterWhere(['like', 'COMMENTS', $this->COMMENTS]); return $dataProvider; }