Completed
Push — master ( 6ac12a...b2cb7f )
by Alexey
05:07
created

Image::relations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
/**
4
 * Item image
5
 *
6
 * @author Alexey Krupskiy <[email protected]>
7
 * @link http://inji.ru/
8
 * @copyright 2016 Alexey Krupskiy
9
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
10
 */
11
12
namespace Ecommerce\Item;
13
14
class Image extends \Model
15
{
16
    static $cols = [
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $cols.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
17
        'file_id' => ['type' => 'image'],
18
        'item_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'item'],
19
        'name' => ['type' => 'text'],
20
        'description' => ['type' => 'html']
21
    ];
22
23
    static function relations()
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...
24
    {
25
        return [
26
            'item' => [
27
                'col' => 'item_id',
28
                'model' => 'Ecommerce\Item'
29
            ],
30
            'file' => [
31
                'col' => 'file_id',
32
                'model' => 'Files\File'
33
            ]
34
        ];
35
    }
36
37
    static $dataManagers = [
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $dataManagers.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
38
        'manager' => [
39
            'cols' => [
40
                'file_id', 'name'
41
            ]
42
        ]
43
    ];
44
    static $forms = [
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $forms.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
45
        'manager' => [
46
            'map' => [
47
                ['name'],
48
                ['item_id', 'file_id'],
49
                ['description']
50
            ]
51
        ]
52
    ];
53
54
}
55