models/QuestionBankSearch.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 = QuestionBank::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            'question_bank_id' => $this->question_bank_id,
            'question_type_id' => $this->question_type_id,
            'nos_option' => $this->nos_option,
            'category_id' => $this->category_id,
            'level_id' => $this->level_id,
            'has_figure' => $this->has_figure, 
            'max_mark' => $this->max_mark, 
            'time_alloted' => $this->time_alloted,
            'no_time_served' => $this->no_time_served,
            'no_time_corrected' => $this->no_time_corrected,
            'no_time_incorrected' => $this->no_time_incorrected,
            'no_time_unattempted' => $this->no_time_unattempted,
        ]);
        $query->andFilterWhere(['like', 'question', $this->question])
            ->andFilterWhere(['like', 'description', $this->description]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = QuestionBank :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'question_bank_id' => $ this -> question_bank_id , 'question_type_id' => $ this -> question_type_id , 'nos_option' => $ this -> nos_option , 'category_id' => $ this -> category_id , 'level_id' => $ this -> level_id , 'has_figure' => $ this -> has_figure , 'max_mark' => $ this -> max_mark , 'time_alloted' => $ this -> time_alloted , 'no_time_served' => $ this -> no_time_served , 'no_time_corrected' => $ this -> no_time_corrected , 'no_time_incorrected' => $ this -> no_time_incorrected , 'no_time_unattempted' => $ this -> no_time_unattempted , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'question' , $ this -> question ] ) -> andFilterWhere ( [ 'like' , 'description' , $ this -> description ] ) ; 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