Completed
Push — master ( 3029f1...135fa8 )
by Alexey
05:33
created

Item::name()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
c 1
b 1
f 0
nc 1
nop 0
dl 4
loc 4
rs 10
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
    public static $dataManagers = [
29
        'manager' => [
30
            'cols' => ['value', 'date_create']
31
        ]
32
    ];
33
    public static $forms = [
34
        'manager' => [
35
            'map' => [
36
                ['item_option_id', 'value']
37
            ]
38
        ]
39
    ];
40
41
    function name()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
42
    {
43
        return $this->value;
44
    }
45
46
    public static function relations()
47
    {
48
        return [
49
            'option' => [
50
                'model' => 'Ecommerce\Item\Option',
51
                'col' => 'item_option_id'
52
            ]
53
        ];
54
    }
55
56
}
57