Quota   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 9
dl 0
loc 45
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getEndUrls() 0 4 1
A tableName() 0 3 1
A rules() 0 3 1
A getEndMessages() 0 4 1
A primaryKey() 0 3 1
1
<?php
2
3
namespace dameter\abstracts\models;
4
5
use dameter\abstracts\WithLanguageSettingsModel;
6
7
8
/**
9
 * Class Quota
10
 * @property integer $quota_id
11
 * @property integer $type_id
12
 *
13
 * @property QuotaText[] $endMessages
14
 * @property QuotaText[] $endUrls
15
 *
16
 * @package dameter\abstract\models
17
 * @author Tõnis Ormisson <[email protected]>
18
 */
19
class Quota extends WithLanguageSettingsModel
20
{
21
    public static $settingsClass = QuotaText::class;
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public static function tableName()
27
    {
28
        return "quota";
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public static function primaryKey()
35
    {
36
        return ["quota_id"];
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function rules()
43
    {
44
        return array_merge(parent::rules(), [
45
        ]);
46
    }
47
48
    /**
49
     * @return \yii\db\ActiveQuery
50
     */
51
    public function getEndMessages()
52
    {
53
        $query = $this->getTexts();
54
        return $query->andWhere(['type_id' => QuotaText::TYPE_END_MESSAGE]);
55
    }
56
57
    /**
58
     * @return \yii\db\ActiveQuery
59
     */
60
    public function getEndUrls()
61
    {
62
        $query = $this->getTexts();
63
        return $query->andWhere(['type_id' => QuotaText::TYPE_END_URL]);
64
    }
65
66
67
}