SettingsValue   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A byImportSettingsSetId() 0 3 1
A byType() 0 3 1
A byImportFileId() 0 2 1
1
<?php
2
/**
3
 * User: execut
4
 * Date: 29.07.16
5
 * Time: 17:06
6
 */
7
8
namespace execut\import\models\queries;
9
10
use execut\import\models;
11
use yii\db\ActiveQuery;
12
13
class SettingsValue extends ActiveQuery
14
{
15
    public function byImportFileId($id) {
16
        return $this->byImportSettingsSetId(models\SettingsSet::find()->byImportFileId($id)->select('id'));
17
    }
18
19
    public function byImportSettingsSetId($id) {
20
        return $this->andWhere([
21
            'import_settings_set_id' => $id,
22
        ]);
23
    }
24
25
    public function byType($value) {
26
        return $this->andWhere([
27
            'type' => $value,
28
        ]);
29
    }
30
}