1 | <?php |
||
25 | class Form extends \Model { |
||
26 | |||
27 | public static $objectName = 'Форма обращения с сайта'; |
||
28 | public static $labels = [ |
||
29 | 'name' => 'Название', |
||
30 | 'description' => 'Описание', |
||
31 | 'user_id' => 'Пользователь', |
||
32 | 'inputs' => 'Поля формы', |
||
33 | 'submit' => 'Текст кнопки отправки', |
||
34 | 'date_create' => 'Дата' |
||
35 | ]; |
||
36 | public static $cols = [ |
||
37 | 'name' => ['type' => 'text'], |
||
38 | 'submit' => ['type' => 'text'], |
||
39 | 'description' => ['type' => 'html'], |
||
40 | 'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
||
41 | 'date_create' => ['type' => 'dateTime'], |
||
42 | //Менеджеры |
||
43 | 'inputsMgr' => ['type' => 'dataManager', 'relation' => 'inputs'], |
||
44 | ]; |
||
45 | public static $dataManagers = [ |
||
46 | 'manager' => [ |
||
47 | 'cols' => [ |
||
48 | 'name', |
||
49 | 'inputs', |
||
50 | 'submit', |
||
51 | 'user_id', |
||
52 | 'date_create', |
||
53 | ] |
||
54 | ] |
||
55 | ]; |
||
56 | public static $forms = [ |
||
57 | 'manager' => [ |
||
58 | 'name' => 'Форма приема обращений с сайта', |
||
59 | 'map' => [ |
||
60 | ['name', 'submit'], |
||
61 | ['description'], |
||
62 | ['inputsMgr'], |
||
63 | ] |
||
64 | ] |
||
65 | ]; |
||
66 | |||
67 | public function beforeSave() { |
||
72 | |||
73 | public static function relations() { |
||
86 | |||
87 | } |
||
88 |