| @@ 12-57 (lines=46) @@ | ||
| 9 | */ |
|
| 10 | namespace Users; |
|
| 11 | ||
| 12 | class Group extends \Model |
|
| 13 | { |
|
| 14 | public static $objectName = 'Группа пользователей'; |
|
| 15 | public static $labels = [ |
|
| 16 | 'name' => 'Название', |
|
| 17 | 'user' => 'Пользователи', |
|
| 18 | 'role' => 'Роли' |
|
| 19 | ]; |
|
| 20 | public static $cols = [ |
|
| 21 | 'name' => ['type' => 'text'], |
|
| 22 | 'user' => ['type' => 'select', 'source' => 'relation', 'relation' => 'users'], |
|
| 23 | 'role' => ['type' => 'select', 'source' => 'relation', 'relation' => 'roles'], |
|
| 24 | ]; |
|
| 25 | public static $dataManagers = [ |
|
| 26 | 'manager' => [ |
|
| 27 | 'name' => 'Группы пользователей', |
|
| 28 | 'cols' => [ |
|
| 29 | 'name', 'role', 'user' |
|
| 30 | ] |
|
| 31 | ] |
|
| 32 | ]; |
|
| 33 | public static $forms = [ |
|
| 34 | 'manager' => [ |
|
| 35 | 'map' => [ |
|
| 36 | ['name'] |
|
| 37 | ] |
|
| 38 | ] |
|
| 39 | ]; |
|
| 40 | ||
| 41 | public static function relations() |
|
| 42 | { |
|
| 43 | return [ |
|
| 44 | 'roles' => [ |
|
| 45 | 'type' => 'many', |
|
| 46 | 'model' => 'Users\Role', |
|
| 47 | 'col' => 'group_id' |
|
| 48 | ], |
|
| 49 | 'users' => [ |
|
| 50 | 'type' => 'many', |
|
| 51 | 'model' => 'Users\User', |
|
| 52 | 'col' => 'group_id' |
|
| 53 | ] |
|
| 54 | ]; |
|
| 55 | } |
|
| 56 | ||
| 57 | } |
|
| 58 | ||
| @@ 14-58 (lines=45) @@ | ||
| 11 | ||
| 12 | namespace Users; |
|
| 13 | ||
| 14 | class Activity extends \Model |
|
| 15 | {
|
|
| 16 | public static $objectName = 'Activity'; |
|
| 17 | public static $labels = [ |
|
| 18 | 'text' => 'Текст', |
|
| 19 | 'user_id' => 'Пользователь', |
|
| 20 | 'category_id' => 'Категория', |
|
| 21 | ]; |
|
| 22 | public static $cols = [ |
|
| 23 | 'text' => ['type' => 'text'], |
|
| 24 | 'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
| 25 | 'category_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'category'], |
|
| 26 | ]; |
|
| 27 | public static $dataManagers = [ |
|
| 28 | 'manager' => [ |
|
| 29 | 'name' => 'Activity', |
|
| 30 | 'cols' => [ |
|
| 31 | 'text', 'user_id', 'category_id', 'date_create', |
|
| 32 | ] |
|
| 33 | ] |
|
| 34 | ]; |
|
| 35 | public static $forms = [ |
|
| 36 | 'manager' => [ |
|
| 37 | 'map' => [ |
|
| 38 | ['text'], |
|
| 39 | ['user_id', 'category_id'] |
|
| 40 | ] |
|
| 41 | ] |
|
| 42 | ]; |
|
| 43 | ||
| 44 | public static function relations() |
|
| 45 | {
|
|
| 46 | return [ |
|
| 47 | 'user' => [ |
|
| 48 | 'model' => 'Users\User', |
|
| 49 | 'col' => 'user_id' |
|
| 50 | ], |
|
| 51 | 'category' => [ |
|
| 52 | 'model' => 'Users\Activity\Category', |
|
| 53 | 'col' => 'category_id' |
|
| 54 | ], |
|
| 55 | ]; |
|
| 56 | } |
|
| 57 | ||
| 58 | } |
|
| 59 | ||
| @@ 14-57 (lines=44) @@ | ||
| 11 | ||
| 12 | namespace Migrations\Log; |
|
| 13 | ||
| 14 | class Event extends \Model |
|
| 15 | { |
|
| 16 | public static $objectName = 'Событие истории миграции'; |
|
| 17 | public static $labels = [ |
|
| 18 | 'type' => 'Тип', |
|
| 19 | 'info' => 'Информация', |
|
| 20 | 'date_create' => 'Дата события' |
|
| 21 | ]; |
|
| 22 | public static $cols = [ |
|
| 23 | 'type' => ['type' => 'text'], |
|
| 24 | 'info' => ['type' => 'textarea'], |
|
| 25 | 'log_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'log'], |
|
| 26 | 'map_path_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'path'], |
|
| 27 | 'date_create' => ['type' => 'dateTime'], |
|
| 28 | ]; |
|
| 29 | public static $dataManagers = [ |
|
| 30 | 'manager' => [ |
|
| 31 | 'cols' => ['type', 'info', 'date_create'] |
|
| 32 | ] |
|
| 33 | ]; |
|
| 34 | public static $forms = [ |
|
| 35 | 'manager' => [ |
|
| 36 | 'map' => [ |
|
| 37 | ['type'], |
|
| 38 | ['info'], |
|
| 39 | ] |
|
| 40 | ] |
|
| 41 | ]; |
|
| 42 | ||
| 43 | public static function relations() |
|
| 44 | { |
|
| 45 | return [ |
|
| 46 | 'log' => [ |
|
| 47 | 'col' => 'log_id', |
|
| 48 | 'model' => 'Migrations\Log' |
|
| 49 | ], |
|
| 50 | 'path' => [ |
|
| 51 | 'col' => 'map_path_id', |
|
| 52 | 'model' => 'Migrations\Migrations\Map\Path' |
|
| 53 | ] |
|
| 54 | ]; |
|
| 55 | } |
|
| 56 | ||
| 57 | } |
|
| 58 | ||