Code Duplication    Length = 19-23 lines in 4 locations

system/modules/Ecommerce/models/Delivery/Save.php 1 location

@@ 14-36 (lines=23) @@
11
12
namespace Ecommerce\Delivery;
13
14
class Save extends \Model {
15
16
    public static $cols = [
17
        'name' => ['type' => 'text'],
18
        'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user']
19
    ];
20
21
    public static function relations() {
22
        return [
23
            'values' => [
24
                'type' => 'many',
25
                'model' => 'Ecommerce\Delivery\Value',
26
                'col' => 'delivery_save_id',
27
                'resultKey' => 'delivery_field_id',
28
            ],
29
            'user' => [
30
                'model' => 'Users\User',
31
                'col' => 'user_id'
32
            ]
33
        ];
34
    }
35
36
}
37

system/modules/Users/models/Session.php 1 location

@@ 14-33 (lines=20) @@
11
12
namespace Users;
13
14
class Session extends \Model {
15
16
    public static $logging = false;
17
    public static $cols = [
18
        'hash' => ['type' => 'text'],
19
        'ip' => ['type' => 'text'],
20
        'agent' => ['type' => 'text'],
21
        'user_id' => ['type' => 'select', 'source' => 'realtion', 'relation' => 'user'],
22
        'date_create' => ['type' => 'dateTime']
23
    ];
24
25
    public static function relations() {
26
        return [
27
            'user' => [
28
                'model' => '\Users\User',
29
                'col' => 'user_id'
30
            ]
31
        ];
32
    }
33
}

system/modules/Notifications/models/Chanel.php 1 location

@@ 14-32 (lines=19) @@
11
12
namespace Notifications;
13
14
class Chanel extends \Model {
15
16
    static $cols = [
17
        'name' => ['type' => 'text'],
18
        'alias' => ['type' => 'text'],
19
        'path' => ['type' => 'text'],
20
        'parent_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'parent'],
21
        'date_create' => ['type' => 'dateTime']
22
    ];
23
24
    static function relations() {
25
        return [
26
            'parent' => [
27
                'model' => 'Notifications\Chanel',
28
                'col' => 'parent_id'
29
            ]
30
        ];
31
    }
32
}

system/modules/Notifications/models/Subscriber.php 1 location

@@ 14-36 (lines=23) @@
11
12
namespace Notifications;
13
14
class Subscriber extends \Model {
15
16
    public static $logging = false;
17
    static $cols = [
18
        'key' => ['type' => 'text'],
19
        'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'],
20
        'date_create' => ['type' => 'dateTime']
21
    ];
22
23
    static function relations() {
24
        return [
25
            'user' => [
26
                'model' => 'Users\User',
27
                'col' => 'user_id'
28
            ],
29
            'subscribes' => [
30
                'type' => 'many',
31
                'Notifications\Subscribe',
32
                'col' => 'subscriber_id'
33
            ]
34
        ];
35
    }
36
}