Plan::attributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * API for Billing
4
 *
5
 * @link      https://github.com/hiqdev/billing-hiapi
6
 * @package   billing-hiapi
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\billing\hiapi\models;
12
13
use hiqdev\yii\DataMapper\models\AbstractModel;
14
use hiqdev\yii\DataMapper\query\attributes\BooleanAttribute;
15
use hiqdev\yii\DataMapper\query\attributes\IntegerAttribute;
16
use hiqdev\yii\DataMapper\query\attributes\StringAttribute;
17
18
class Plan extends AbstractModel
19
{
20
    public function attributes()
21
    {
22
        return [
23
            'id'          => IntegerAttribute::class,
24
            'name'        => StringAttribute::class,
25
            'is_grouping' => BooleanAttribute::class,
26
        ];
27
    }
28
29
    public function relations()
30
    {
31
        return [
32
            'type' => Type::class,
33
            'seller' => Customer::class,
34
        ];
35
    }
36
}
37