| Conditions | 3 |
| Paths | 2 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 3 |
| Changes | 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 | ); |
||
| 55 | |||
| 56 | 1 | if (!($this->load($params) && $this->validate())) { |
|
| 57 | 1 | 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 | ); |
||
| 67 | |||
| 68 | 1 | $query->andFilterWhere(['like', 'key', $this->key]) |
|
| 69 | 1 | ->andFilterWhere(['like', 'value', $this->value]); |
|
| 70 | |||
| 71 | 1 | return $dataProvider; |
|
| 72 | } |
||
| 73 | } |
||
| 74 |