| Conditions | 2 |
| Paths | 2 |
| Total Lines | 30 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 54 | public function search($params) |
||
| 55 | { |
||
| 56 | $query = Album::find(); |
||
| 57 | |||
| 58 | // add conditions that should always apply here |
||
| 59 | |||
| 60 | $dataProvider = new ActiveDataProvider([ |
||
| 61 | 'query' => $query, |
||
| 62 | ]); |
||
| 63 | |||
| 64 | $this->load($params); |
||
| 65 | |||
| 66 | if (!$this->validate()) { |
||
| 67 | // uncomment the following line if you do not want to return any records when validation fails |
||
| 68 | // $query->where('0=1'); |
||
| 69 | return $dataProvider; |
||
| 70 | } |
||
| 71 | |||
| 72 | // grid filtering conditions |
||
| 73 | $query->andFilterWhere([ |
||
| 74 | 'id' => $this->id, |
||
| 75 | 'created_at' => $this->created_at, |
||
| 76 | 'updated_at' => $this->updated_at, |
||
| 77 | ]); |
||
| 78 | |||
| 79 | $query->andFilterWhere(['like', 'title', $this->title]) |
||
| 80 | ->andFilterWhere(['like', 'description', $this->description]) |
||
| 81 | ->andFilterWhere(['like', 'type', $this->type]); |
||
| 82 | |||
| 83 | return $dataProvider; |
||
| 84 | } |
||
| 86 |