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

Template::type()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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