Test Failed
Pull Request — master (#20)
by
unknown
04:23
created

Modules::getSource()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
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 Modules extends AbstractModel
7
{
8
    /**
9
     *
10
     * @var integer
11
     */
12
    public $id;
13
14
    /**
15
     *
16
     * @var integer
17
     */
18
    public $apps_id;
19
20
    /**
21
     *
22
     * @var string
23
     */
24
    public $name;
25
26
    /**
27
     *
28
     * @var integer
29
     */
30
    public $is_deleted;
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
     * Initialize method for model.
46
     */
47 1
    public function initialize()
48
    {
49 1
        $this->setSource('modules');
50
51
        // $this->belongsTo(
52
        //     'company_id',
53
        //     'Gewaer\Models\Companies',
54
        //     'id',
55
        //     ['alias' => 'company']
56
        // );
57
58 1
        $this->hasMany(
59 1
            'id',
60 1
            'Gewaer\CustomFields\CustomFields',
61 1
            'modules_id',
62 1
            ['alias' => 'fields']
63
        );
64
65
        // $this->belongsTo(
66
        //     'apps_id',
67
        //     'Gewaer\Models\Apps',
68
        //     'id',
69
        //     ['alias' => 'app']
70
        // );
71 1
    }
72
73
    /**
74
     * Returns table name mapped in the model.
75
     *
76
     * @return string
77
     */
78 1
    public function getSource(): string
79
    {
80 1
        return 'modules';
81
    }
82
}
83