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

Item::relations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 9
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 9
loc 9
rs 9.6666
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
/**
4
 * Item option item
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\Item\Option;
13
14 View Code Duplication
class Item extends \Model
15
{
16
    public static $objectName = 'Элемент коллекции опции';
17
    public static $cols = [
18
        //Основные параметры
19
        'item_option_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'option'],
20
        'value' => ['type' => 'text'],
21
        //Системные
22
        'weight' => ['type' => 'number'],
23
        'date_create' => ['type' => 'dateTime']
24
    ];
25
    public static $labels = [
26
        'value' => 'Значение'
27
    ];
28
29
    public static function relations()
30
    {
31
        return [
32
            'option' => [
33
                'model' => 'Ecommerce\Item\Option',
34
                'col' => 'item_option_id'
35
            ]
36
        ];
37
    }
38
39
}
40