Passed
Pull Request — master (#21)
by Maximo
04:23
created

SystemModules   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 101
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 29
dl 0
loc 101
ccs 0
cts 26
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 26 1
A getSource() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Gewaer\Models;
5
6
class SystemModules extends AbstractModel
7
{
8
    /**
9
     *
10
     * @var integer
11
     */
12
    public $id;
13
14
    /**
15
     *
16
     * @var integer
17
     */
18
    public $name;
19
20
    /**
21
     *
22
     * @var integer
23
     */
24
    public $slug;
25
26
    /**
27
     *
28
     * @var string
29
     */
30
    public $model_name;
31
32
    /**
33
     *
34
     * @var integer
35
     */
36
    public $apps_id;
37
38
    /**
39
     *
40
     * @var integer
41
     */
42
    public $parents_id;
43
44
    /**
45
     *
46
     * @var integer
47
     */
48
    public $menu_order;
49
50
    /**
51
     *
52
     * @var string
53
     */
54
    public $created_at;
55
56
    /**
57
     *
58
     * @var string
59
     */
60
    public $updated_at;
61
62
    /**
63
     *
64
     * @var integer
65
     */
66
    public $is_deleted;
67
68
    /**
69
     * Initialize method for model.
70
     */
71
    public function initialize()
72
    {
73
        parent::initialize();
0 ignored issues
show
Bug introduced by
The method initialize() does not exist on Gewaer\Models\AbstractModel. Since it exists in all sub-types, consider adding an abstract or default implementation to Gewaer\Models\AbstractModel. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

73
        parent::/** @scrutinizer ignore-call */ 
74
                initialize();
Loading history...
74
75
        $this->belongsTo(
76
            'company_id',
77
            'Gewaer\Models\Companies',
78
            'id',
79
            ['alias' => 'company']
80
        );
81
82
        $this->belongsTo(
83
            'apps_id',
84
            'Gewaer\Models\Apps',
85
            'id',
86
            ['alias' => 'app']
87
        );
88
89
        $this->belongsTo(
90
            'company_branches_id',
91
            'Gewaer\Models\CompanyBranches',
92
            'id',
93
            ['alias' => 'companyBranch']
94
        );
95
96
        $this->setSource('user_company_apps_activities');
97
    }
98
99
    /**
100
     * Returns table name mapped in the model.
101
     *
102
     * @return string
103
     */
104
    public function getSource(): string
105
    {
106
        return 'user_company_apps_activities';
107
    }
108
}
109