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

Reminder::index()   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 4
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 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