Passed
Pull Request — master (#34)
by
unknown
03:34
created

EmailTemplatesVariables::initialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 38
Code Lines 26

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 27
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 26
nc 1
nop 0
dl 0
loc 38
ccs 27
cts 27
cp 1
crap 1
rs 9.504
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Gewaer\Models;
5
6
/**
7
 * Classs for Email Templates
8
 * @property Users $userData
9
 * @property Request $request
10
 * @property Config $config
11
 * @property Apps $app
12
 * @property \Phalcon\DI $di
13
 *
14
 */
15
class EmailTemplatesVariables extends AbstractModel
16
{
17
    /**
18
     *
19
     * @var integer
20
     */
21
    public $id;
22
23
    /**
24
     *
25
     * @var string
26
     */
27
    public $companies_id;
28
29
    /**
30
     *
31
     * @var integer
32
     */
33
    public $apps_id;
34
35
    /**
36
     *
37
     * @var integer
38
     */
39
    public $system_modules_id;
40
41
    /**
42
     *
43
     * @var string
44
     */
45
    public $users_id;
46
47
    /**
48
     *
49
     * @var integer
50
     */
51
    public $email_templates_id;
52
53
    /**
54
     *
55
     * @var string
56
     */
57
    public $name;
58
59
    /**
60
     *
61
     * @var integer
62
     */
63
    public $value;
64
65
    /**
66
     *
67
     * @var integer
68
     */
69
    public $is_deleted;
70
71
    /**
72
     *
73
     * @var string
74
     */
75
    public $created_at;
76
77
    /**
78
     *
79
     * @var string
80
     */
81
    public $updated_at;
82
83
    /**
84
     * Initialize method for model.
85
     */
86 2
    public function initialize()
87
    {
88 2
        $this->hasMany(
89 2
            'id',
90 2
            'Gewaer\Models\EmailTemplatesVariables',
91 2
            'system_modules_id',
92 2
            ['alias' => 'template-variables']
93
        );
94
95 2
        $this->belongsTo(
96 2
            'companies_id',
97 2
            'Gewaer\Models\Companies',
98 2
            'id',
99 2
            ['alias' => 'company']
100
        );
101
102 2
        $this->belongsTo(
103 2
            'apps_id',
104 2
            'Gewaer\Models\Apps',
105 2
            'id',
106 2
            ['alias' => 'app']
107
        );
108
109 2
        $this->belongsTo(
110 2
            'users_id',
111 2
            'Gewaer\Models\Users',
112 2
            'id',
113 2
            ['alias' => 'user']
114
        );
115
116 2
        $this->belongsTo(
117 2
            'system_modules_id',
118 2
            'Gewaer\Models\SystemModules',
119 2
            'id',
120 2
            ['alias' => 'system-modules']
121
        );
122
123 2
        $this->setSource('email_templates_variables');
124 2
    }
125
126
    /**
127
     * Returns table name mapped in the model.
128
     *
129
     * @return string
130
     */
131 2
    public function getSource(): string
132
    {
133 2
        return 'email_templates_variables';
134
    }
135
}
136