SettingQuery::active()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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