Conditions | 2 |
Paths | 2 |
Total Lines | 28 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
37 | public function search(array $params): ActiveDataProvider |
||
38 | { |
||
39 | $query = self::find(); |
||
40 | |||
41 | $dataProvider = new ActiveDataProvider([ |
||
42 | 'query' => $query, |
||
43 | 'pagination' => [ |
||
44 | 'pageSize' => $this->pageSize, |
||
45 | ], |
||
46 | ]); |
||
47 | |||
48 | $this->load($params); |
||
49 | |||
50 | if (!$this->validate()) { |
||
51 | return $dataProvider; |
||
52 | } |
||
53 | |||
54 | $query->andFilterWhere([ |
||
55 | 'status' => $this->status, |
||
56 | 'section' => $this->section, |
||
57 | 'type' => $this->type, |
||
58 | ]); |
||
59 | |||
60 | $query->andFilterWhere(['like', 'key', $this->key]) |
||
61 | ->andFilterWhere(['like', 'value', $this->value]) |
||
62 | ->andFilterWhere(['like', 'description', $this->description]); |
||
63 | |||
64 | return $dataProvider; |
||
65 | } |
||
67 |