1 | <?php |
||
35 | class Delivery extends \Model { |
||
36 | |||
37 | public static $objectName = 'Доставка'; |
||
38 | public static $cols = [ |
||
39 | //Основные параметры |
||
40 | 'name' => ['type' => 'text'], |
||
41 | 'delivery_provider_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'provider'], |
||
42 | 'price' => ['type' => 'decimal'], |
||
43 | 'currency_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'currency'], |
||
44 | 'price_text' => ['type' => 'textarea'], |
||
45 | 'max_cart_price' => ['type' => 'decimal'], |
||
46 | 'icon_file_id' => ['type' => 'image'], |
||
47 | 'info' => ['type' => 'html'], |
||
48 | 'disabled' => ['type' => 'bool'], |
||
49 | 'default' => ['type' => 'bool'], |
||
50 | //Системные |
||
51 | 'weight' => ['type' => 'number'], |
||
52 | 'date_create' => ['type' => 'dateTime'], |
||
53 | //Менеджеры |
||
54 | 'field' => ['type' => 'dataManager', 'relation' => 'fields'], |
||
55 | 'priceChanger' => ['type' => 'dataManager', 'relation' => 'prices'], |
||
56 | 'disabledPayTypesMgr' => ['type' => 'dataManager', 'relation' => 'disabledPayTypes'], |
||
57 | ]; |
||
58 | public static $labels = [ |
||
59 | 'name' => 'Название', |
||
60 | 'price_type' => 'Тип расчета стоимости', |
||
61 | 'price' => 'Стоимость', |
||
62 | 'price_text' => 'Текстовое описание стоимости (отображается вместо цены)', |
||
63 | 'max_cart_price' => 'Басплатно при', |
||
64 | 'icon_file_id' => 'Иконка', |
||
65 | 'currency_id' => 'Валюта', |
||
66 | 'info' => 'Дополнительная информация', |
||
67 | 'priceChanger' => 'Градация стоимости', |
||
68 | 'field' => 'Поля', |
||
69 | 'disabled' => 'Отключено', |
||
70 | 'default' => 'По умолчанию', |
||
71 | 'disabledPayTypesMgr' => 'Недоступные способы оплаты', |
||
72 | ]; |
||
73 | public static $dataManagers = [ |
||
74 | 'manager' => [ |
||
75 | 'name' => 'Варианты доставки', |
||
76 | 'cols' => [ |
||
77 | 'name', |
||
78 | 'delivery_provider_id', |
||
79 | 'price', |
||
80 | 'currency_id', |
||
81 | 'max_cart_price', |
||
82 | 'disabled', |
||
83 | 'default', |
||
84 | 'field', |
||
85 | 'priceChanger', |
||
86 | 'disabledPayTypesMgr' |
||
87 | ], |
||
88 | 'sortMode' => true |
||
89 | ], |
||
90 | ]; |
||
91 | public static $forms = [ |
||
92 | 'manager' => [ |
||
93 | 'map' => [ |
||
94 | ['name', 'delivery_provider_id'], |
||
95 | ['default', 'disabled'], |
||
96 | ['price', 'currency_id'], |
||
97 | ['max_cart_price', 'icon_file_id'], |
||
98 | ['price_text'], |
||
99 | ['info'], |
||
100 | ['priceChanger'], |
||
101 | ['field'], |
||
102 | ['disabledPayTypesMgr'] |
||
103 | ] |
||
104 | ] |
||
105 | ]; |
||
106 | |||
107 | public static function relations() { |
||
138 | |||
139 | public function providerHelper() { |
||
145 | |||
146 | function beforeSave() { |
||
151 | } |
||
152 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.