Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
table.php
1<?php
2
4
10
11Loc::loadMessages(__FILE__);
12
48class Table extends Entity\DataManager
49{
50 public static function getFilePath()
51 {
52 return __FILE__;
53 }
54
55 public static function getTableName()
56 {
57 return 'b_sale_delivery_srv';
58 }
59
60 public static function getMap()
61 {
62 return array(
63 'ID' => array(
64 'data_type' => 'integer',
65 'primary' => true,
66 'autocomplete' => true,
67 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_ID_FIELD'),
68 ),
69 'CODE' => array(
70 'data_type' => 'string',
71 'validation' => array(__CLASS__, 'validateCode'),
72 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_CODE_FIELD'),
73 ),
74 'PARENT_ID' => array(
75 'data_type' => 'integer',
76 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_PARENT_ID_FIELD'),
77 ),
78 'PARENT' => array(
79 'data_type' => '\Bitrix\Sale\Delivery\Services\Table',
80 'reference' => array(
81 '=this.PARENT_ID' => 'ref.ID'
82 )
83 ),
84 'NAME' => array(
85 'data_type' => 'string',
86 'required' => true,
87 'validation' => array(__CLASS__, 'validateName'),
88 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_NAME_FIELD'),
89 ),
90 'ACTIVE' => array(
91 'data_type' => 'boolean',
92 'values' => array('N', 'Y'),
93 'required' => true,
94 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_ACTIVE_FIELD'),
95 ),
96 'DESCRIPTION' => array(
97 'data_type' => 'string',
98 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_DESCRIPTION_FIELD'),
99 ),
100 'SORT' => array(
101 'data_type' => 'integer',
102 'default_value' => 100,
103 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_SORT_FIELD'),
104 ),
105 'LOGOTIP' => array(
106 'data_type' => 'integer',
107 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_LOGOTIP_FIELD'),
108 ),
109 'CONFIG' => array(
110 'data_type' => 'text',
111 'serialized' => true,
112 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_CONFIG_FIELD'),
113 ),
114 'CLASS_NAME' => array(
115 'data_type' => 'string',
116 'validation' => array(__CLASS__, 'validateClassName'),
117 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_CLASS_NAME_FIELD'),
118 ),
119 'CURRENCY' => array(
120 'data_type' => 'string',
121 'validation' => array(__CLASS__, 'validateCurrency'),
122 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_CURRENCY_FIELD'),
123 ),
124 'TRACKING_PARAMS' => array(
125 'data_type' => 'text',
126 'serialized' => true,
127 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_TRACKING_PARAMS_FIELD'),
128 ),
129 'ALLOW_EDIT_SHIPMENT' => array(
130 'data_type' => 'boolean',
131 'values' => array('N', 'Y'),
132 'default_value' => 'Y',
133 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_ALLOW_EDIT_SHIPMENT_FIELD')
134 ),
135 'VAT_ID' => array(
136 'data_type' => 'integer',
137 'title' => Loc::getMessage('DELIVERY_SERVICE_ENTITY_VAT_ID_FIELD')
138 ),
139 'XML_ID' => array(
140 'data_type' => 'string',
141 ),
142 );
143 }
144
145 public static function validateCode()
146 {
147 return array(
148 new Entity\Validator\Length(null, 50),
149 );
150 }
151 public static function validateName()
152 {
153 return array(
154 new Entity\Validator\Length(null, 255),
155 );
156 }
157 public static function validateCurrency()
158 {
159 return array(
160 new Entity\Validator\Length(null, 3),
161 );
162 }
163 public static function validateClassName()
164 {
165 return array(
166 new Entity\Validator\Length(null, 255),
167 );
168 }
169
170 /* Deprecated methods moved to manager. Will be removed in future versions. */
171
175 public static function getIdByCode($code)
176 {
177 return Services\Manager::getIdByCode($code);
178 }
179
183 public static function getCodeById($id)
184 {
185 return Services\Manager::getCodeById($id);
186 }
187
193 public static function delete($primary)
194 {
196 {
197 $cacheManager = Application::getInstance()->getManagedCache();
198 $cacheManager->clean(EmptyDeliveryService::CACHE_ID);
199 }
200
201 return parent::delete($primary);
202 }
203}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29