Failed Conditions
Pull Request — master (#55)
by Rafael
07:05
created

UsersAssociatedApps::initialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 17
ccs 12
cts 12
cp 1
crap 1
rs 9.9
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Gewaer\Models;
5
6
class UsersAssociatedApps 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 $companies_id;
25
26
    /**
27
     *
28
     * @var string
29
     */
30
    public $identify_id;
31
32
    /**
33
     *
34
     * @var integer
35
     */
36
    public $user_active;
37
38
    /**
39
     *
40
     * @var string
41
     */
42
    public $user_role;
43
44
    /**
45
     * Initialize method for model.
46
     */
47 4
    public function initialize()
48
    {
49 4
        $this->belongsTo(
50 4
            'companies_id',
51 4
            'Gewaer\Models\Companies',
52 4
            'id',
53 4
            ['alias' => 'company']
54
        );
55
56 4
        $this->belongsTo(
57 4
            'apps_id',
58 4
            'Gewaer\Models\Apps',
59 4
            'id',
60 4
            ['alias' => 'app']
61
        );
62
63 4
        $this->setSource('users_associated_apps');
64 4
    }
65
66
    /**
67
     * Returns table name mapped in the model.
68
     *
69
     * @return string
70
     */
71 4
    public function getSource(): string
72
    {
73 4
        return 'users_associated_apps';
74
    }
75
}
76