models/CentralesSearch.php
/**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
Creates data provider instance with search query applied
@param array $params


Creates data provider instance with search query applied @param array $params
public function search($params)
    {
        $query = Centrales::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->joinWith('eSTADO');
        $query->andFilterWhere([
            'ID' => $this->ID,
            'PARROQUIA_ID' => $this->PARROQUIA_ID,
            'MUNICIPIO_ID' => $this->MUNICIPIO_ID,
            'TELEFONO_1' => $this->TELEFONO_1,
            'TELEFONO_2' => $this->TELEFONO_2,
        ]);
        $query->andFilterWhere(['like', 'NOMBRE', $this->NOMBRE])
            ->andFilterWhere(['like', 'RIF', $this->RIF])
            ->andFilterWhere(['like', 'DIRECCION', $this->DIRECCION])
            ->andFilterWhere(['like', 'ESTATUS', $this->ESTATUS])
            ->andFilterWhere(['like', 'eSTADO.NOMBRE', $this->ESTADO_ID]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = Centrales :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> joinWith ( 'eSTADO' ) ; $ query -> andFilterWhere ( [ 'ID' => $ this -> ID , 'PARROQUIA_ID' => $ this -> PARROQUIA_ID , 'MUNICIPIO_ID' => $ this -> MUNICIPIO_ID , 'TELEFONO_1' => $ this -> TELEFONO_1 , 'TELEFONO_2' => $ this -> TELEFONO_2 , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'NOMBRE' , $ this -> NOMBRE ] ) -> andFilterWhere ( [ 'like' , 'RIF' , $ this -> RIF ] ) -> andFilterWhere ( [ 'like' , 'DIRECCION' , $ this -> DIRECCION ] ) -> andFilterWhere ( [ 'like' , 'ESTATUS' , $ this -> ESTATUS ] ) -> andFilterWhere ( [ 'like' , 'eSTADO.NOMBRE' , $ this -> ESTADO_ID ] ) ; return $ dataProvider ; }
Creates data provider instance with search query applied
 @param array $params
Creates data provider instance with search query applied @param array $params
// add conditions that should always apply here // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); // grid filtering conditions