Test Failed
Branch add-core-tests (a060d8)
by Rafael
05:48
created

AppsSettings   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 15
c 2
b 0
f 0
dl 0
loc 67
ccs 10
cts 10
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSource() 0 3 1
A initialize() 0 10 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Canvas\Models;
5
use Canvas\Models\Apps;
6
7
class AppsSettings extends AbstractModel
8
{
9
    /**
10
     *
11
     * @var integer
12
     */
13
    public $apps_id;
14
15
    /**
16
     *
17
     * @var string
18
     */
19
    public $name;
20
21
    /**
22
     *
23
     * @var string
24
     */
25
    public $value;
26
27
    /**
28
     *
29
     * @var string
30
     */
31
    public $created_at;
32
33
    /**
34
     *
35
     * @var string
36
     */
37
    public $updated_at;
38
39
    /**
40
     *
41
     * @var integer
42
     */
43
    public $is_deleted;
44
45
    /**
46
     * Sub based app key word
47
     */
48
    const SUBSCRIPTION_BASED = 'subscription_based';
49
50
    /**
51
     * Initialize method for model.
52
     */
53 3
    public function initialize()
54
    {
55
56 3
        $this->setSource('apps_settings');
57
58 3
        $this->belongsTo(
59 3
            'apps_id',
60 3
            'Canvas\Models\Apps',
61 3
            'id',
62 3
            ['alias' => 'app']
63
        );
64 3
    }
65
66
    /**
67
     * Returns table name mapped in the model.
68
     *
69
     * @return string
70
     */
71 3
    public function getSource() : string
72
    {
73 3
        return 'apps_settings';
74
    }
75
}
76