1 | <?php |
||
31 | class Field extends \Model { |
||
32 | |||
33 | public static $objectName = 'Поле информации при заказе'; |
||
34 | public static $cols = [ |
||
35 | //Основные параметры |
||
36 | 'name' => ['type' => 'text'], |
||
37 | 'type' => ['type' => 'select', 'source' => 'array', 'empty' => false, 'sourceArray' => [ |
||
38 | 'text' => 'Текстовое поле', |
||
39 | 'textarea' => 'Многострочный текст', |
||
40 | 'select' => 'Выпадающий список', |
||
41 | ]], |
||
42 | 'code' => ['type' => 'text'], |
||
43 | 'options' => ['type' => 'textarea'], |
||
44 | 'userfield' => ['type' => 'text'], |
||
45 | 'placeholder' => ['type' => 'text'], |
||
46 | 'help_text' => ['type' => 'text'], |
||
47 | 'required' => ['type' => 'bool'], |
||
48 | 'save' => ['type' => 'bool'], |
||
49 | //Системные |
||
50 | 'fieldItem' => ['type' => 'dataManager', 'relation' => 'fieldItems'], |
||
51 | 'weight' => ['type' => 'number'], |
||
52 | 'date_create' => ['type' => 'dateTime'], |
||
53 | ]; |
||
54 | public static $labels = [ |
||
55 | 'name' => 'Название', |
||
56 | 'type' => 'Тип', |
||
57 | 'required' => 'Обязательно', |
||
58 | 'placeholder' => 'Плейсхолдер', |
||
59 | 'userfield' => 'Связь с полем профиля', |
||
60 | 'help_text' => 'Подсказка для заполнения', |
||
61 | 'save' => 'Сохраняется', |
||
62 | 'options' => 'Системные настройки поля', |
||
63 | ]; |
||
64 | public static $dataManagers = [ |
||
65 | 'manager' => [ |
||
66 | 'cols' => [ |
||
67 | 'name', 'type', 'userfield', 'placeholder', 'required', 'save' |
||
68 | ], |
||
69 | 'sortMode' => true |
||
70 | ] |
||
71 | ]; |
||
72 | public static $forms = [ |
||
73 | 'manager' => [ |
||
74 | 'map' => [ |
||
75 | ['name', 'type'], |
||
76 | ['required', 'save'], |
||
77 | ['userfield', 'placeholder'], |
||
78 | ['help_text'], |
||
79 | ['options'] |
||
80 | ] |
||
81 | ] |
||
82 | ]; |
||
83 | |||
84 | public static function relations() { |
||
93 | } |
||
94 |