Failed Conditions
Push — master ( 55bfad...b74acd )
by Maximo
02:48
created

CustomFields   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 99
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 28
dl 0
loc 99
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 23 1
A getSource() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Gewaer\CustomFields;
5
6
use Gewaer\Models\AbstractModel;
7
8
class CustomFields extends AbstractModel
9
{
10
    /**
11
     *
12
     * @var integer
13
     */
14
    public $id;
15
16
    /**
17
     *
18
     * @var integer
19
     */
20
    public $users_id;
21
22
    /**
23
     *
24
     * @var integer
25
     */
26
    public $companies_id;
27
28
    /**
29
     *
30
     * @var integer
31
     */
32
    public $apps_id;
33
34
    /**
35
     *
36
     * @var string
37
     */
38
    public $name;
39
40
    /**
41
     *
42
     * @var integer
43
     */
44
    public $custom_fields_modules_id;
45
46
    /**
47
     *
48
     * @var integer
49
     */
50
    public $fields_type_id;
51
52
    /**
53
     *
54
     * @var integer
55
     */
56
    public $is_deleted;
57
58
    /**
59
     *
60
     * @var string
61
     */
62
    public $created_at;
63
64
    /**
65
     *
66
     * @var string
67
     */
68
    public $updated_at;
69
70
    /**
71
     * Initialize method for model.
72
     */
73 6
    public function initialize()
74
    {
75 6
        $this->setSource('custom_fields');
76
77 6
        $this->belongsTo(
78 6
            'custom_fields_modules_id',
79 6
            'Gewaer\Models\CustomFieldsModules',
80 6
            'id',
81 6
            ['alias' => 'modules']
82
        );
83
84 6
        $this->hasMany(
85 6
            'id',
86 6
            'Gewaer\Models\CompanyCustomFields',
87 6
            'custom_field_id',
88 6
            ['alias' => 'company-fields']
89
        );
90
91 6
        $this->belongsTo(
92 6
            'companies_id',
93 6
            'Gewaer\Models\Apps',
94 6
            'id',
95 6
            ['alias' => 'companies']
96
        );
97 6
    }
98
99
    /**
100
     * Returns table name mapped in the model.
101
     *
102
     * @return string
103
     */
104 6
    public function getSource(): string
105
    {
106 6
        return 'custom_fields';
107
    }
108
}
109