Price   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A attributes() 0 5 1
A relations() 0 9 1
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\php\units\Unit;
14
use hiqdev\yii\DataMapper\models\AbstractModel;
15
use hiqdev\yii\DataMapper\query\attributes\IntegerAttribute;
16
use hiqdev\yii\DataMapper\query\attributes\StringAttribute;
17
18
/**
19
 * Class Price.
20
 *
21
 * @property Target target
22
 */
23
class Price extends AbstractModel
24
{
25
    public function attributes()
26
    {
27
        return [
28
            'id' => IntegerAttribute::class,
29
            'data' => StringAttribute::class,
30
        ];
31
    }
32
33
    public function relations()
34
    {
35
        return [
36
            'plan' => Plan::class,
37
            'target' => Target::class,
38
            'type' => Type::class,
39
            'unit' => Unit::class,
40
            'price' => Money::class,
41
            'prepaid' => Quantity::class,
42
        ];
43
    }
44
}
45