48 $itemsFromDbList = BasketTable::getList(
51 'SET_PARENT_ID' => $id,
53 "select" => array(
"ID")
56 while ($itemsFromDbItem = $itemsFromDbList->fetch())
57 BasketTable::deleteWithItems($itemsFromDbItem[
'ID']);
59 return BasketTable::deleteWithItems($id);
68 public static function deleteWithItems($id)
76 $dbRes = BasketPropertyTable::getList([
78 "filter" => [
"BASKET_ID" => $id],
80 while ($item = $dbRes->fetch())
82 BasketPropertyTable::delete($item[
"ID"]);
86 $service = ServiceLocator::getInstance()->get(
'sale.basketReservation');
89 "filter" => [
"BASKET_ID" => $id],
91 while ($item = $dbRes->fetch())
93 $service->delete($item[
"ID"]);
96 return BasketTable::delete($id);
104 return 'b_sale_basket';
114 $connection = Main\Application::getConnection();
115 $helper = $connection->getSqlHelper();
119 'data_type' =>
'integer',
121 'autocomplete' =>
true,
124 'data_type' =>
'string',
126 'validation' => array(__CLASS__,
'validateLid'),
129 'data_type' =>
'integer',
133 new Main\
Entity\ReferenceField(
135 'Bitrix\Sale\Internals\Fuser',
136 array(
'=this.FUSER_ID' =>
'ref.ID'),
137 array(
'join_type' =>
'INNER')
140 new Main\
Entity\ReferenceField(
143 array(
'=ref.ID' =>
'this.FUSER.USER_ID')
147 'data_type' =>
'integer'
150 new Main\
Entity\ReferenceField(
152 'Bitrix\Sale\Internals\Order',
153 array(
'=this.ORDER_ID' =>
'ref.ID')
156 'PRODUCT_ID' => array(
157 'data_type' =>
'integer',
161 'data_type' =>
'Product',
162 'reference' => array(
163 '=this.PRODUCT_ID' =>
'ref.ID'
166 'PRODUCT_PRICE_ID' => array(
167 'data_type' =>
'integer'
169 'PRICE_TYPE_ID' => array(
170 'data_type' =>
'integer'
173 'data_type' =>
'string'
178 $helper->getConcatFunction(
"%s",
"' ['",
"%s",
"']'"),
179 array(
'NAME',
'PRODUCT_ID')
187 'data_type' =>
'string',
189 'validation' => array(__CLASS__,
'validateCurrency'),
196 'VAT_INCLUDED' => array(
197 'data_type' =>
'boolean',
198 'values' => array(
'Y',
'N')
201 'DATE_INSERT' => array(
202 'data_type' =>
'datetime'
206 $DB->datetimeToDateFunction(
'%s'),
207 array(
'DATE_INSERT'),
208 array(
'data_type' =>
'datetime')
211 'DATE_UPDATE' => array(
212 'data_type' =>
'datetime'
216 $DB->datetimeToDateFunction(
'%s'),
217 array(
'DATE_UPDATE'),
218 array(
'data_type' =>
'datetime')
221 'DATE_REFRESH' => array(
222 'data_type' =>
'datetime'
226 $DB->datetimeToDateFunction(
'%s'),
227 array(
'DATE_REFRESH'),
228 array(
'data_type' =>
'datetime')
243 'data_type' =>
'boolean',
244 'values' => array(
'N',
'Y')
247 'SUMMARY_PRICE' => array(
248 'data_type' =>
'float',
249 'expression' => array(
250 '(%s * %s)',
'QUANTITY',
'PRICE'
255 'data_type' =>
'boolean',
256 'values' => array(
'N',
'Y')
259 'MARKING_CODE_GROUP' => array(
260 'data_type' =>
'string',
264 'data_type' =>
'string'
267 'PRODUCT_PROVIDER_CLASS' => array(
268 'data_type' =>
'string'
272 'data_type' =>
'string'
275 'DETAIL_PAGE_URL' => array(
276 'data_type' =>
'string'
282 'default_value' =>
'0.00'
286 'CATALOG_XML_ID' => array(
287 'data_type' =>
'string'
290 'PRODUCT_XML_ID' => array(
291 'data_type' =>
'string'
294 'DISCOUNT_NAME' => array(
295 'data_type' =>
'string',
296 'validation' => array(__CLASS__,
'validateDiscountName'),
299 'DISCOUNT_VALUE' => array(
300 'data_type' =>
'string',
301 'validation' => array(__CLASS__,
'validateDiscountValue'),
304 'DISCOUNT_COUPON' => array(
305 'data_type' =>
'string',
306 'validation' => array(__CLASS__,
'validateDiscountCoupon'),
319 'SUBSCRIBE' => array(
320 'data_type' =>
'boolean',
321 'values' => array(
'N',
'Y')
323 'N_SUBSCRIBE' => array(
324 'data_type' =>
'integer',
325 'expression' => array(
326 'CASE WHEN %s = \'Y\' THEN 1 ELSE 0 END',
'SUBSCRIBE'
331 'data_type' =>
'boolean',
332 'values' => array(
'N',
'Y'),
339 'BARCODE_MULTI' => array(
340 'data_type' =>
'boolean',
341 'values' => array(
'N',
'Y')
344 'CUSTOM_PRICE' => array(
345 'data_type' =>
'boolean',
346 'values' => array(
'N',
'Y')
349 'DIMENSIONS' => array(
350 'serialized' =>
true,
351 'data_type' =>
'string'
364 'MEASURE_NAME' => array(
365 'data_type' =>
'string'
368 'CALLBACK_FUNC' => array(
369 'data_type' =>
'string'
372 'ORDER_CALLBACK_FUNC' => array(
373 'data_type' =>
'string'
376 'CANCEL_CALLBACK_FUNC' => array(
377 'data_type' =>
'string'
380 'PAY_CALLBACK_FUNC' => array(
381 'data_type' =>
'string'
384 'RECOMMENDATION' => array(
385 'data_type' =>
'string'
389 'ALL_PRICE' => array(
390 'data_type' =>
'float',
391 'expression' => array(
392 '(%s + %s)',
'PRICE',
'DISCOUNT_PRICE'
396 'SUMMARY_PURCHASING_PRICE' => array(
397 'data_type' =>
'float',
398 'expression' => array(
399 '(%s) * %s',
'PRODUCT.PURCHASING_PRICE_IN_SITE_CURRENCY',
'QUANTITY'
402 'GROSS_PROFIT' => array(
403 'data_type' =>
'float',
404 'expression' => array(
405 '(%s) - (%s)',
'SUMMARY_PRICE',
'SUMMARY_PURCHASING_PRICE'
408 'PROFITABILITY' => array(
409 'data_type' =>
'float',
410 'expression' => array(
411 'CASE WHEN %s is NULL OR %s=0 THEN NULL ELSE (%s) * 100 / (%s) END',
412 'SUMMARY_PURCHASING_PRICE',
'SUMMARY_PURCHASING_PRICE',
'GROSS_PROFIT',
'SUMMARY_PURCHASING_PRICE'
416 'SHIPMENT_ITEM' => array(
417 'data_type' =>
'ShipmentItem',
418 'reference' => array(
419 '=ref.BASKET_ID' =>
'this.ID',
423 'data_type' =>
'Shipment',
424 'reference' => array(
425 '=ref.ID' =>
'this.SHIPMENT_ITEM.ORDER_DELIVERY_ID',
430 'data_type' =>
'Payment',
431 'reference' => array(
432 '=ref.ORDER_ID' =>
'this.ORDER_ID',
444 'data_type' =>
'string'
457 new Main\
Entity\Validator\Length(
null, 3),
469 new Main\
Entity\Validator\Length(
null, 2),
481 new Main\
Entity\Validator\Length(
null, 255),
493 new Main\
Entity\Validator\Length(
null, 32),
505 new Main\
Entity\Validator\Length(
null, 32),
static loadMessages($file)
static getList(array $parameters=array())