1 | <?php |
||
16 | class Review extends \Model { |
||
17 | |||
18 | public static $cols = [ |
||
19 | 'item_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'item'], |
||
20 | 'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
||
21 | 'name' => ['type' => 'text'], |
||
22 | 'mail' => ['type' => 'email'], |
||
23 | 'text' => ['type' => 'textarea'], |
||
24 | 'rating' => ['type' => 'number'], |
||
25 | 'file_id' => ['type' => 'file'], |
||
26 | 'status' => ['type' => 'select', 'source' => 'array', 'default' => 'new', 'sourceArray' => [ |
||
27 | 'new' => 'Новый', |
||
28 | 'accept' => 'Принят', |
||
29 | 'denied' => 'Недопущен' |
||
30 | ] |
||
31 | ], |
||
32 | 'voteup' => ['type' => 'number'], |
||
33 | 'votedown' => ['type' => 'number'], |
||
34 | 'date_create' => ['type' => 'dateTime'] |
||
35 | ]; |
||
36 | public static $labels = [ |
||
37 | 'item_id' => 'Товар', |
||
38 | 'user_id' => 'Пользователь', |
||
39 | 'name' => 'Имя', |
||
40 | 'mail' => 'Email', |
||
41 | 'text' => 'Текст отзыва', |
||
42 | 'rating' => 'Оценка', |
||
43 | 'file_id' => 'Вложение', |
||
44 | 'status' => 'Статус модерации', |
||
45 | 'date_create' => 'Дата' |
||
46 | ]; |
||
47 | public static $dataManagers = [ |
||
48 | 'manager' => [ |
||
49 | 'cols' => ['name', 'item_id', 'status', 'mail', 'user_id', 'rating', 'date_create'] |
||
50 | ] |
||
51 | ]; |
||
52 | public static $forms = [ |
||
53 | 'manager' => [ |
||
54 | 'map' => [ |
||
55 | ['name', 'mail'], |
||
56 | ['text'], |
||
57 | ['rating', 'status'], |
||
58 | ['voteup', 'votedown'] |
||
59 | ] |
||
60 | ] |
||
61 | ]; |
||
62 | |||
63 | public static function relations() { |
||
75 | } |