AppsSettings::getSource()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Canvas\Models;
5
6
use Canvas\Models\Apps;
7
8
class AppsSettings extends AbstractModel
9
{
10
    /**
11
     * Default number of settings for an app.
12
     */
13
    const APP_DEFAULT_SETTINGS_NUMBER = 16;
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 string
29
     */
30
    public $value;
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
     *
46
     * @var integer
47
     */
48
    public $is_deleted;
49
50
    /**
51
     * Sub based app key word.
52
     */
53
    const SUBSCRIPTION_BASED = 'subscription_based';
54
55
    /**
56
     * Initialize method for model.
57
     */
58
    public function initialize()
59
    {
60
        $this->setSource('apps_settings');
61
62
        $this->belongsTo(
63
            'apps_id',
64
            'Canvas\Models\Apps',
65
            'id',
66
            ['alias' => 'app']
67
        );
68
    }
69
70
    /**
71
     * Returns table name mapped in the model.
72
     *
73
     * @return string
74
     */
75
    public function getSource() : string
76
    {
77
        return 'apps_settings';
78
    }
79
}
80