Failed Conditions
Pull Request — master (#55)
by Rafael
06:42
created

UsersAssociatedCompanies::initialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 12
ccs 8
cts 8
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Gewaer\Models;
5
6
class UsersAssociatedCompanies extends \Baka\Auth\Models\UsersAssociatedCompany
7
{
8
    /**
9
     *
10
     * @var integer
11
     */
12
    public $users_id;
13
14
    /**
15
     *
16
     * @var integer
17
     */
18
    public $companies_id;
19
20
    /**
21
     *
22
     * @var string
23
     */
24
    public $identify_id;
25
26
    /**
27
     *
28
     * @var integer
29
     */
30
    public $user_active;
31
32
    /**
33
     *
34
     * @var string
35
     */
36
    public $user_role;
37
38
    /**
39
     * Initialize method for model.
40
     */
41 9
    public function initialize()
42
    {
43 9
        parent::initialize();
44
45 9
        $this->belongsTo(
46 9
            'companies_id',
47 9
            'Gewaer\Models\Companies',
48 9
            'id',
49 9
            ['alias' => 'company']
50
        );
51
52 9
        $this->setSource('users_associated_company');
53 9
    }
54
55
    /**
56
     * Returns table name mapped in the model.
57
     *
58
     * @return string
59
     */
60 8
    public function getSource(): string
61
    {
62 8
        return 'users_associated_company';
63
    }
64
}
65