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

Webhooks   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 99
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 28
dl 0
loc 99
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSource() 0 3 1
A initialize() 0 23 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Gewaer\Models;
5
6
class Webhooks extends AbstractModel
7
{
8
    /**
9
     *
10
     * @var integer
11
     */
12
    public $id;
13
14
    /**
15
     *
16
     * @var integer
17
     */
18
    public $system_modules_id;
19
20
    /**
21
     *
22
     * @var integer
23
     */
24
    public $apps_id;
25
26
    /**
27
     *
28
     * @var string
29
     */
30
    public $name;
31
32
    /**
33
     *
34
     * @var string
35
     */
36
    public $description;
37
38
    /**
39
     *
40
     * @var string
41
     */
42
    public $action;
43
44
    /**
45
     *
46
     * @var string
47
     */
48
    public $format;
49
50
    /**
51
     *
52
     * @var integer
53
     */
54
    public $is_deleted;
55
56
    /**
57
     *
58
     * @var string
59
     */
60
    public $created_at;
61
62
    /**
63
     *
64
     * @var string
65
     */
66
    public $updated_at;
67
68
    /**
69
     * Initialize method for model.
70
     */
71 5
    public function initialize()
72
    {
73 5
        $this->setSource('webhooks');
74
75 5
        $this->hasMany(
76 5
            'id',
77 5
            'Gewaer\Models\UserWebhooks',
78 5
            'webhooks_id',
79 5
            ['alias' => 'user-webhooks']
80
        );
81
82 5
        $this->belongsTo(
83 5
            'system_modules_id',
84 5
            'Gewaer\Models\SystemModules',
85 5
            'id',
86 5
            ['alias' => 'modules']
87
        );
88
89 5
        $this->belongsTo(
90 5
            'apps_id',
91 5
            'Gewaer\Models\Apps',
92 5
            'id',
93 5
            ['alias' => 'apps']
94
        );
95 5
    }
96
97
    /**
98
     * Returns table name mapped in the model.
99
     *
100
     * @return string
101
     */
102 5
    public function getSource(): string
103
    {
104 5
        return 'webhooks';
105
    }
106
}
107