public function search($params) { $query = Sede::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'establecimiento_id' => $this->establecimiento_id, 'principal' => $this->principal]); $query->andFilterWhere(['like', 'codigo', $this->codigo])->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'telefono', $this->telefono])->andFilterWhere(['like', 'telefono_alternativo', $this->telefono_alternativo])->andFilterWhere(['like', 'fax', $this->fax]); return $dataProvider; }