Sale::attributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 2
Metric Value
eloc 3
c 2
b 0
f 2
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 10
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\DateTimeAttribute;
15
use hiqdev\yii\DataMapper\query\attributes\IntegerAttribute;
16
17
class Sale extends AbstractModel
18
{
19
    public function attributes()
20
    {
21
        return [
22
            'id' => IntegerAttribute::class,
23
            'time' => DateTimeAttribute::class,
24
        ];
25
    }
26
27
    public function relations()
28
    {
29
        return [
30
            'target' => Target::class,
31
            'seller' => Customer::class,
32
            'customer' => Customer::class,
33
            'plan' => Plan::class,
34
        ];
35
    }
36
}
37