Passed
Pull Request — master (#16)
by Maximo
03:37
created

AccessList   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 73
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 9 1
A getSource() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gewaer\Models;
6
7
class AccessList extends AbstractModel
8
{
9
    /**
10
     *
11
     * @var string
12
     */
13
    public $roles_name;
14
15
    /**
16
     *
17
     * @var string
18
     */
19
    public $resource_name;
20
21
    /**
22
     *
23
     * @var string
24
     */
25
    public $access_name;
26
27
    /**
28
     *
29
     * @var integer
30
     */
31
    public $allowed;
32
33
    /**
34
     *
35
     * @var integer
36
     */
37
    public $apps_id;
38
39
    /**
40
     *
41
     * @var string
42
     */
43
    public $created_at;
44
45
    /**
46
     *
47
     * @var string
48
     */
49
    public $updated_at;
50
51
    /**
52
     *
53
     * @var integer
54
     */
55
    public $is_deleted;
56
57
    /**
58
     * Initialize method for model.
59
     */
60
    public function initialize()
61
    {
62
        $this->setSource('access_list');
63
64
        $this->belongsTo(
65
            'roles_name',
66
            'Gewaer\Models\Roles',
67
            'name',
68
            ['alias' => 'role']
69
        );
70
    }
71
72
    /**
73
     * Returns table name mapped in the model.
74
     *
75
     * @return string
76
     */
77
    public function getSource(): string
78
    {
79
        return 'access_list';
80
    }
81
}
82