PaymentFrequencies::initialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 9
ccs 0
cts 4
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Canvas\Models;
5
6
class PaymentFrequencies extends AbstractModel
7
{
8
    /**
9
     *
10
     * @var integer
11
     */
12
    public $id;
13
14
    /**
15
     *
16
     * @var string
17
     */
18
    public $name;
19
20
    /**
21
     *
22
     * @var integer
23
     */
24
    public $is_deleted;
25
26
    /**
27
     *
28
     * @var string
29
     */
30
    public $created_at;
31
32
    /**
33
     *
34
     * @var string
35
     */
36
    public $updated_at;
37
38
    /**
39
     * Initialize method for model.
40
     */
41
    public function initialize()
42
    {
43
        $this->setSource('payment_frequencies');
44
45
        $this->hasMany(
46
            'id',
47
            'Canvas\Models\AppsPlans',
48
            'payment_frequencies_id',
49
            ['alias' => 'plans']
50
        );
51
    }
52
53
    /**
54
     * Returns table name mapped in the model.
55
     *
56
     * @return string
57
     */
58
    public function getSource(): string
59
    {
60
        return 'payment_frequencies';
61
    }
62
}
63