SettingQuery   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 3
c 2
b 1
f 0
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A active() 0 3 1
A inactive() 0 3 1
1
<?php
2
3
namespace yii2mod\settings\models;
4
5
use yii\db\ActiveQuery;
6
use yii2mod\settings\models\enumerables\SettingStatus;
7
8
/**
9
 * Class SettingQuery
10
 *
11
 * @package yii2mod\settings\models
12
 */
13
class SettingQuery extends ActiveQuery
14
{
15
    /**
16
     * Scope for settings with active status
17
     *
18
     * @return $this
19
     */
20
    public function active()
21
    {
22
        return $this->andWhere(['status' => SettingStatus::ACTIVE]);
23
    }
24
25
    /**
26
     * Scope for settings with inactive status
27
     *
28
     * @return $this
29
     */
30
    public function inactive()
31
    {
32
        return $this->andWhere(['status' => SettingStatus::INACTIVE]);
33
    }
34
}
35