1 | <?php |
||
36 | class Price extends \Model { |
||
37 | |||
38 | public static $objectName = 'Цена'; |
||
39 | public static $cols = [ |
||
40 | //Основные параметры |
||
41 | 'item_offer_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'offer'], |
||
42 | 'item_offer_price_type_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'type'], |
||
43 | 'name' => ['type' => 'text'], |
||
44 | 'price' => ['type' => 'decimal'], |
||
45 | 'currency_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'currency'], |
||
46 | //Системные |
||
47 | 'weight' => ['type' => 'text'], |
||
48 | 'date_create' => ['type' => 'dateTime'], |
||
49 | ]; |
||
50 | public static $labels = [ |
||
51 | 'price' => 'Цена', |
||
52 | 'item_offer_price_type_id' => 'Тип цены', |
||
53 | 'item_offer_id' => 'Товар', |
||
54 | 'currency_id' => 'Валюта', |
||
55 | ]; |
||
56 | public static $dataManagers = [ |
||
57 | 'manager' => [ |
||
58 | 'name' => 'Цены', |
||
59 | 'cols' => [ |
||
60 | 'item_offer_price_type_id', |
||
61 | 'price', |
||
62 | 'currency_id', |
||
63 | ] |
||
64 | ], |
||
65 | ]; |
||
66 | public static $forms = [ |
||
67 | 'manager' => [ |
||
68 | 'map' => [ |
||
69 | ['price', 'currency_id'], |
||
70 | ['item_offer_price_type_id'] |
||
71 | ] |
||
72 | ] |
||
73 | ]; |
||
74 | |||
75 | /** |
||
76 | * @param bool|\Users\User $user |
||
77 | * @return bool |
||
78 | */ |
||
79 | public function checkUserAccess($user = false) { |
||
86 | |||
87 | public function name() { |
||
98 | |||
99 | public static function relations() { |
||
115 | |||
116 | } |
||
117 |