Conditions | 3 |
Paths | 2 |
Total Lines | 27 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 3.0026 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
46 | 1 | public function search($params) |
|
47 | { |
||
48 | 1 | $query = Setting::find(); |
|
49 | |||
50 | 1 | $dataProvider = new ActiveDataProvider( |
|
51 | [ |
||
52 | 1 | 'query' => $query, |
|
53 | ] |
||
54 | 1 | ); |
|
55 | |||
56 | 1 | if (!($this->load($params) && $this->validate())) { |
|
57 | return $dataProvider; |
||
58 | } |
||
59 | |||
60 | 1 | $query->andFilterWhere( |
|
61 | [ |
||
62 | 1 | 'id' => $this->id, |
|
63 | 1 | 'active' => $this->active, |
|
64 | 1 | 'section' => $this->section, |
|
65 | ] |
||
66 | 1 | ); |
|
67 | |||
68 | 1 | $query->andFilterWhere(['like', 'key', $this->key]) |
|
69 | 1 | ->andFilterWhere(['like', 'value', $this->value]); |
|
70 | |||
71 | 1 | return $dataProvider; |
|
72 | } |
||
73 | } |
||
74 |