Test Failed
Push — master ( d0ec41...3b9ce6 )
by Maximo
02:08
created

UserRoles   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 90
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 31
dl 0
loc 90
ccs 0
cts 32
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 32 1
A getSource() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Gewaer\Models;
5
6
class UserRoles extends AbstractModel
7
{
8
    /**
9
     *
10
     * @var integer
11
     */
12
    public $users_id;
13
14
    /**
15
     *
16
     * @var integer
17
     */
18
    public $apps_id;
19
20
    /**
21
     *
22
     * @var integer
23
     */
24
    public $roles_id;
25
26
    /**
27
     *
28
     * @var integer
29
     */
30
    public $company_id;
31
32
    /**
33
     *
34
     * @var string
35
     */
36
    public $created_at;
37
38
    /**
39
     *
40
     * @var string
41
     */
42
    public $updated_at;
43
44
    /**
45
     *
46
     * @var integer
47
     */
48
    public $is_deleted;
49
50
    /**
51
     * Initialize method for model.
52
     */
53
    public function initialize()
54
    {
55
        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

55
        parent::/** @scrutinizer ignore-call */ 
56
                initialize();
Loading history...
56
57
        $this->setSource('user_roles');
58
59
        $this->belongsTo(
60
            'users_id',
61
            'Gewaer\Models\Users',
62
            'id',
63
            ['alias' => 'user']
64
        );
65
66
        $this->belongsTo(
67
            'roles_id',
68
            'Gewaer\Models\Roles',
69
            'id',
70
            ['alias' => 'roles']
71
        );
72
73
        $this->belongsTo(
74
            'apps_id',
75
            'Gewaer\Models\Apps',
76
            'id',
77
            ['alias' => 'app']
78
        );
79
80
        $this->belongsTo(
81
            'company_id',
82
            'Gewaer\Models\Companies',
83
            'id',
84
            ['alias' => 'company']
85
        );
86
    }
87
88
    /**
89
     * Returns table name mapped in the model.
90
     *
91
     * @return string
92
     */
93
    public function getSource(): string
94
    {
95
        return 'user_roles';
96
    }
97
}
98