Code Duplication    Length = 25-31 lines in 3 locations

system/modules/Ecommerce/models/Item/Offer/Bonus.php 1 location

@@ 14-38 (lines=25) @@
11
12
namespace Ecommerce\Item\Offer;
13
14
class Bonus extends \Model
15
{
16
    public static $cols = [
17
        //Основные параметры
18
        'item_offer_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'offer'],
19
        'type' => ['type' => 'text'],
20
        'value' => ['type' => 'text'],
21
        'count' => ['type' => 'decimal'],
22
        'limited' => ['type' => 'bool'],
23
        'left' => ['type' => 'number'],
24
        //Системные
25
        'date_create' => ['type' => 'dateTime']
26
    ];
27
28
    public static function relations()
29
    {
30
        return [
31
            'offer' => [
32
                'model' => 'Ecommerce\Item\Offer',
33
                'col' => 'item_offer_id'
34
            ]
35
        ];
36
    }
37
38
}
39

system/modules/Ecommerce/models/Item/Option/Relation.php 1 location

@@ 14-40 (lines=27) @@
11
12
namespace Ecommerce\Item\Option;
13
14
class Relation extends \Model
15
{
16
    public static $objectName = 'Связь каталога и опций';
17
    public static $cols = [
18
        //Основные параметры
19
        'category_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'category'],
20
        'item_option_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'option'],
21
        //Системные
22
        'weight' => ['type' => 'number'],
23
        'date_create' => ['type' => 'dateTime']
24
    ];
25
26
    public static function relations()
27
    {
28
        return [
29
            'category' => [
30
                'model' => 'Ecommerce\Category',
31
                'col' => 'category_id'
32
            ],
33
            'option' => [
34
                'model' => 'Ecommerce\Item\Option',
35
                'col' => 'item_option_id'
36
            ],
37
        ];
38
    }
39
40
}
41

system/modules/Ecommerce/models/UserAdds.php 1 location

@@ 14-44 (lines=31) @@
11
12
namespace Ecommerce;
13
14
class UserAdds extends \Model
15
{
16
    public static $labels = [
17
        'value' => 'Информация'
18
    ];
19
    public static $cols = [
20
        //Основные параметры
21
        'name' => ['type' => 'text'],
22
        'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'],
23
        //Системные
24
        'date_create' => ['type' => 'dateTime'],
25
        //Менеджеры
26
        'value' => ['type' => 'dataManager', 'relation' => 'values'],
27
    ];
28
29
    public static function relations()
30
    {
31
        return [
32
            'values' => [
33
                'type' => 'many',
34
                'model' => 'Ecommerce\UserAdds\Value',
35
                'col' => 'useradds_id',
36
            ],
37
            'user' => [
38
                'model' => 'Users\User',
39
                'col' => 'user_id',
40
            ],
41
        ];
42
    }
43
44
}
45