Completed
Push — master ( e5cfcd...8d78f6 )
by Andrii
14:44
created

Template::tableName()   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 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * HiPanel tickets module
5
 *
6
 * @link      https://github.com/hiqdev/hipanel-module-ticket
7
 * @package   hipanel-module-ticket
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hipanel\modules\ticket\models;
13
14
use hisite\modules\news\models\Article;
15
use Yii;
16
17
class Template extends Article
18
{
19
    public static $i18nDictionary = 'hipanel:ticket';
20
21
    public static function tableName()
22
    {
23
        return 'article';
24
    }
25
26
    public function init()
27
    {
28
        $this->realm = 'ticket_template';
29
        $this->type = 'default';
30
    }
31
32
    public static function find($options = [])
33
    {
34
        return parent::find($options)->andWhere([
35
            'realm' => 'ticket_template',
36
        ]);
37
    }
38
39
    public function attributeLabels()
40
    {
41
        return $this->mergeAttributeLabels([
42
            'name' => Yii::t('hipanel:ticket', 'Name'),
43
        ]);
44
    }
45
}
46