Completed
Push — master ( 8717df...fdbe7f )
by Alexey
05:44
created

History   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 21
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A relations() 0 9 1
1
<?php
2
3
/**
4
 * Card item history
5
 *
6
 * @author Alexey Krupskiy <[email protected]>
7
 * @link http://inji.ru/
8
 * @copyright 2015 Alexey Krupskiy
9
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
10
 */
11
12
namespace Ecommerce\Card\Item;
13
14
class History extends \Model
15
{
16
    public static $cols = [
17
        //Основные параметры
18
        'card_item_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'cardItem'],
19
        'amount' => ['type' => 'decimal'],
20
        //Системные параметры
21
        'date_create' => ['type' => 'dateTime'],
22
    ];
23
24
    public static function relations()
25
    {
26
        return [
27
            'cardItem' => [
28
                'model' => 'Ecommerce\Card\Item',
29
                'col' => 'card_item_id'
30
            ]
31
        ];
32
    }
33
34
}
35