Completed
Push — master ( 37098b...75747c )
by Klochok
04:23
created

Reminder   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 7
c 1
b 0
f 1
lcom 0
cbo 3
dl 0
loc 72
ccs 0
cts 47
cp 0
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 4 1
A type() 0 4 1
A attributes() 0 11 1
A rules() 0 5 1
A attributeLabels() 0 10 1
A getThread() 0 4 1
A scenarioCommands() 0 8 1
1
<?php
2
3
namespace hipanel\modules\ticket\models;
4
5
use Yii;
6
7
/**
8
 * Class Ticket(threads)
9
 */
10
class Reminder extends \hipanel\base\Model
11
{
12
    use \hipanel\base\ModelTrait;
13
14
    const REMAINDER_TYPE_SITE = 'site';
15
16
    const REMINDER_TYPE_MAIL = 'mail';
17
18
    public static function index()
19
    {
20
        return 'threads';
21
    }
22
23
    public static function type()
24
    {
25
        return 'thread';
26
    }
27
28
    public static $i18nDictionary = 'hipanel/ticket';
29
30
    /**
31
     * @return array
32
     */
33
    public function attributes()
34
    {
35
        return [
36
            'id',
37
            'periodicity',
38
            'from_time',
39
            'client',
40
            'message',
41
            'type',
42
        ];
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function rules()
49
    {
50
        return [
51
        ];
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function attributeLabels()
58
    {
59
        return $this->mergeAttributeLabels([
60
            'periodicity' => Yii::t('hipanel/ticket', 'Periodicity'),
61
            'from_time' => Yii::t('hipanel/ticket', 'When the recall?'),
62
            'client' => Yii::t('hipanel/ticket', 'Client'),
63
            'message' => Yii::t('hipanel/ticket', 'Message'),
64
            'type' => Yii::t('hipanel/ticket', 'Type'),
65
        ]);
66
    }
67
68
    public function getThread()
69
    {
70
        return $this->hasOne(Thread::class, ['id' => 'id']);
71
    }
72
73
    public function scenarioCommands()
74
    {
75
        return [
76
            'create' => 'notify-create',
77
            'answer' => 'notify-answer',
78
            'set-responsible' => 'notify-set-responsible',
79
        ];
80
    }
81
}
82