Completed
Push — master ( d123db...236d99 )
by Dmitry
09:19
created

Template   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 34
ccs 0
cts 18
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 4 1
A type() 0 4 1
A init() 0 5 1
A find() 0 6 1
A attributeLabels() 0 6 1
1
<?php
2
3
namespace hipanel\modules\ticket\models;
4
5
use hisite\modules\news\models\Article;
6
use Yii;
7
8
class Template extends Article
9
{
10
    public static $i18nDictionary = 'hipanel/ticket';
11
12
    public static function index()
13
    {
14
        return 'articles';
15
    }
16
17
    public static function type()
18
    {
19
        return 'article';
20
    }
21
22
    public function init()
23
    {
24
        $this->realm = 'ticket_template';
25
        $this->type = 'default';
26
    }
27
28
    public static function find($options = [])
29
    {
30
        return parent::find($options)->andWhere([
31
            'realm' => 'ticket_template',
32
        ]);
33
    }
34
35
    public function attributeLabels()
36
    {
37
        return $this->mergeAttributeLabels([
38
            'name' => Yii::t('hipanel/ticket', 'Name'),
39
        ]);
40
    }
41
}
42