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

Template   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 29
ccs 0
cts 22
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 5 1
A find() 0 6 1
A attributeLabels() 0 6 1
A tableName() 0 4 1
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