Passed
Pull Request — master (#34)
by Rafael
04:02
created

EmailTemplatesVariables::getSource()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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 string
50
     */
51
    public $name;
52
53
    /**
54
     *
55
     * @var integer
56
     */
57
    public $value;
58
59
    /**
60
     *
61
     * @var integer
62
     */
63
    public $is_deleted;
64
65
    /**
66
     *
67
     * @var string
68
     */
69
    public $created_at;
70
71
    /**
72
     *
73
     * @var string
74
     */
75
    public $updated_at;
76
77
    /**
78
     * Initialize method for model.
79
     */
80 2
    public function initialize()
81
    {
82 2
        $this->belongsTo(
83 2
            'companies_id',
84 2
            'Gewaer\Models\Companies',
85 2
            'id',
86 2
            ['alias' => 'company']
87
        );
88
89 2
        $this->belongsTo(
90 2
            'apps_id',
91 2
            'Gewaer\Models\Apps',
92 2
            'id',
93 2
            ['alias' => 'app']
94
        );
95
96 2
        $this->belongsTo(
97 2
            'users_id',
98 2
            'Gewaer\Models\Users',
99 2
            'id',
100 2
            ['alias' => 'user']
101
        );
102
103 2
        $this->belongsTo(
104 2
            'system_modules_id',
105 2
            'Gewaer\Models\SystemModules',
106 2
            'id',
107 2
            ['alias' => 'system-modules']
108
        );
109
110 2
        $this->setSource('email_templates_variables');
111 2
    }
112
113
    /**
114
     * Returns table name mapped in the model.
115
     *
116
     * @return string
117
     */
118 2
    public function getSource(): string
119
    {
120 2
        return 'email_templates_variables';
121
    }
122
}
123