Passed
Pull Request — master (#35)
by Rafael
04:12
created

UserWebhooks::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 UserWebhooks extends AbstractModel
7
{
8
    /**
9
     *
10
     * @var integer
11
     */
12
    public $id;
13
14
    /**
15
     *
16
     * @var integer
17
     */
18
    public $webhooks_id;
19
20
    /**
21
     *
22
     * @var integer
23
     */
24
    public $apps_id;
25
26
    /**
27
     *
28
     * @var integer
29
     */
30
    public $users_id;
31
32
    /**
33
     *
34
     * @var integer
35
     */
36
    public $companies_id;
37
38
    /**
39
     *
40
     * @var string
41
     */
42
    public $url;
43
44
    /**
45
     *
46
     * @var string
47
     */
48
    public $method;
49
50
    /**
51
     *
52
     * @var string
53
     */
54
    public $format;
55
56
    /**
57
     *
58
     * @var integer
59
     */
60
    public $is_deleted;
61
62
    /**
63
     *
64
     * @var string
65
     */
66
    public $created_at;
67
68
    /**
69
     *
70
     * @var string
71
     */
72
    public $updated_at;
73
74
    /**
75
     * Initialize method for model.
76
     */
77 5
    public function initialize()
78
    {
79 5
        $this->setSource('user_webhooks');
80
81 5
        $this->belongsTo(
82 5
            'webhooks_id',
83 5
            'Gewaer\Models\Webhooks',
84 5
            'id',
85 5
            ['alias' => 'webhooks']
86
        );
87
88 5
        $this->belongsTo(
89 5
            'users_id',
90 5
            'Gewaer\Models\Users',
91 5
            'id',
92 5
            ['alias' => 'users']
93
        );
94
95 5
        $this->belongsTo(
96 5
            'companies_id',
97 5
            'Gewaer\Models\Companies',
98 5
            'id',
99 5
            ['alias' => 'companies']
100
        );
101
102 5
        $this->belongsTo(
103 5
            'apps_id',
104 5
            'Gewaer\Models\Apps',
105 5
            'id',
106 5
            ['alias' => 'apps']
107
        );
108 5
    }
109
110
    /**
111
     * Returns table name mapped in the model.
112
     *
113
     * @return string
114
     */
115 5
    public function getSource(): string
116
    {
117 5
        return 'user_webhooks';
118
    }
119
}
120