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