common/models/search/Term.php
/**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     * @param int $taxonomyId
     * @return ActiveDataProvider
     */
Creates data provider instance with search query applied
@param array $params
@param int $taxonomyId
@return ActiveDataProvider
Creates data provider instance with search query applied @param array $params @param int $taxonomyId @return ActiveDataProvider
public function search($params, $taxonomyId)
    {
        $query = TermModel::find();
        $query->andWhere(['taxonomy_id' => $taxonomyId]);
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'sort' => [
                'defaultOrder' => [
                    'id' => SORT_DESC,
                ],
            ],
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            'id' => $this->id,
            'taxonomy_id' => $this->taxonomy_id,
            'parent' => $this->parent,
            'count' => $this->count,
        ]);
        $query->andFilterWhere(['like', 'name', $this->name])
            ->andFilterWhere(['like', 'slug', $this->slug])
            ->andFilterWhere(['like', 'description', $this->description]);
        return $dataProvider;
    }
public function search ( $ params , $ taxonomyId ) { $ query = TermModel :: find ( ) ; $ query -> andWhere ( [ 'taxonomy_id' => $ taxonomyId ] ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , 'sort' => [ 'defaultOrder' => [ 'id' => SORT_DESC , ] , ] , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'id' => $ this -> id , 'taxonomy_id' => $ this -> taxonomy_id , 'parent' => $ this -> parent , 'count' => $ this -> count , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'name' , $ this -> name ] ) -> andFilterWhere ( [ 'like' , 'slug' , $ this -> slug ] ) -> andFilterWhere ( [ 'like' , 'description' , $ this -> description ] ) ; return $ dataProvider ; }
Creates data provider instance with search query applied
 @param array $params
 @param int $taxonomyId
 @return ActiveDataProvider
Creates data provider instance with search query applied @param array $params @param int $taxonomyId @return ActiveDataProvider