1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
orderdiscount.php
См. документацию.
1<?php
2namespace Bitrix\Sale;
3
4use Bitrix\Main,
5 Bitrix\Main\Localization\Loc,
6 Bitrix\Sale\Internals;
7
8Loc::loadMessages(__FILE__);
9
11{
27
34 public static function getRegistryType()
35 {
37 }
38
45 protected static function validateCoupon(array $fields)
46 {
47 if ($fields['TYPE'] == Internals\DiscountCouponTable::TYPE_ARCHIVED)
48 return new Result();;
49
50 return parent::validateCoupon($fields);
51 }
52
53 /* discounts */
54
61 protected static function getDiscountIterator(array $parameters)
62 {
63 return Internals\DiscountTable::getList($parameters);
64 }
65
66 /* discounts end */
67
68 /* coupons */
69
80
81 /* coupons end */
82
83 /* order discounts */
84
91 protected static function getOrderDiscountIterator(array $parameters)
92 {
93 return Internals\OrderDiscountTable::getList($parameters);
94 }
95
102 protected static function addOrderDiscountInternal(array $fields)
103 {
104 return Internals\OrderDiscountTable::add($fields);
105 }
106
117
124 protected static function normalizeOrderDiscountFieldsInternal(array $rawFields)
125 {
127 return (is_array($result) ? $result : null);
128 }
129
137 {
139 return ($hash === false ? null : $hash);
140 }
141
142 /* order discounts end */
143
144 /* order coupons */
145
152 public static function getOrderCouponIterator(array $parameters)
153 {
154 return Internals\OrderCouponsTable::getList($parameters);
155 }
156
163 protected static function addOrderCouponInternal(array $fields)
164 {
165 return Internals\OrderCouponsTable::add($fields);
166 }
167
168 /* order coupons end */
169
170 /* order discount modules */
171
176 protected static function getOrderDiscountModuleIterator(array $parameters)
177 {
178 return Internals\OrderModulesTable::getList($parameters);
179 }
180
188 protected static function saveOrderDiscountModulesInternal($orderDiscountId, array $modules)
189 {
190 $result = true;
191
193 $orderDiscountId,
195 );
196 if (!$resultModule)
197 {
199 $result = false;
200 }
201 unset($resultModule);
202
203 return $result;
204 }
205
206 /* discount results */
207
214 protected static function getResultEntityInternal($entity)
215 {
216 $result = null;
217
219 $discountClassName = static::getDiscountClassName();
220
221 switch ($entity)
222 {
223 case $discountClassName::ENTITY_BASKET_ITEM:
225 break;
226 case $discountClassName::ENTITY_DELIVERY:
228 break;
229 }
230
231 unset($discountClassName);
232
233 return $result;
234 }
235
242 protected static function getResultEntityFromInternal($entity)
243 {
244 $result = null;
245
247 $discountClassName = static::getDiscountClassName();
248
249 switch ($entity)
250 {
251 case Internals\OrderRulesTable::ENTITY_TYPE_BASKET_ITEM:
252 $result = $discountClassName::ENTITY_BASKET_ITEM;
253 break;
254 case Internals\OrderRulesTable::ENTITY_TYPE_DELIVERY:
255 $result = $discountClassName::ENTITY_DELIVERY;
256 break;
257 }
258
259 unset($discountClassName);
260
261 return $result;
262 }
263
268 protected static function getResultIterator(array $parameters)
269 {
270 if (!isset($parameters['select']))
271 $parameters['select'] = ['*', 'RULE_DESCR' => 'DESCR.DESCR', 'RULE_DESCR_ID' => 'DESCR.ID'];
272 if (!isset($parameters['order']))
273 $parameters['order'] = ['ID' => 'ASC'];
274 return Internals\OrderRulesTable::getList($parameters);
275 }
276
281 protected static function getResultDescriptionIterator(array $parameters)
282 {
283 return Internals\OrderRulesDescrTable::getList($parameters);
284 }
285
291 protected static function getResultTableNameInternal()
292 {
294 }
295
301 protected static function getResultDescriptionTableNameInternal()
302 {
304 }
305
312 protected static function checkResultTableWhiteList(array $fields)
313 {
314 $fields = array_intersect_key($fields, Internals\OrderRulesTable::getEntity()->getScalarFields());
315 return (!empty($fields) ? $fields : null);
316 }
317
325 {
326 $fields = array_intersect_key($fields, Internals\OrderRulesDescrTable::getEntity()->getScalarFields());
327 return (!empty($fields) ? $fields : null);
328 }
329
336 protected static function addResultInternal(array $fields)
337 {
338 return Internals\OrderRulesTable::add($fields);
339 }
340
347 protected static function addResultDescriptionInternal(array $fields)
348 {
349 return Internals\OrderRulesDescrTable::add($fields);
350 }
351
359 protected static function updateResultInternal($id, array $fields)
360 {
361 return Internals\OrderRulesTable::update($id, $fields);
362 }
363
371 protected static function updateResultDescriptionInternal($id, array $fields)
372 {
373 return Internals\OrderRulesDescrTable::update($id, $fields);
374 }
375
376 /* discount results end */
377
378 /* round result */
379
386 protected static function getRoundEntityInternal($entity)
387 {
388 $result = null;
389
391 $discountClassName = static::getDiscountClassName();
392
393 switch ($entity)
394 {
395 case $discountClassName::ENTITY_BASKET_ITEM:
397 break;
398 }
399
400 unset($discountClassName);
401
402 return $result;
403 }
404
411 protected static function getRoundEntityFromInternal($entity)
412 {
413 $result = null;
414
416 $discountClassName = static::getDiscountClassName();
417
418 switch ($entity)
419 {
420 case Internals\OrderRoundTable::ENTITY_TYPE_BASKET_ITEM:
421 $result = $discountClassName::ENTITY_BASKET_ITEM;
422 break;
423 }
424
425 unset($discountClassName);
426
427 return $result;
428 }
429
434 protected static function getRoundResultIterator(array $parameters)
435 {
436 if (empty($parameters['select']))
437 $parameters['select'] = ['*'];
438 return Internals\OrderRoundTable::getList($parameters);
439 }
440
447 protected static function addRoundResultInternal(array $fields)
448 {
449 return Internals\OrderRoundTable::add($fields);
450 }
451
459 protected static function updateRoundResultInternal($id, array $fields)
460 {
461 return Internals\OrderRoundTable::update($id, $fields);
462 }
463
469 protected static function getRoundTableNameInternal()
470 {
472 }
473
474 /* round result end */
475
476 /* data storage */
477
505
510 protected static function getStoredDataIterator(array $parameters)
511 {
512 return Internals\OrderDiscountDataTable::getList($parameters);
513 }
514
521 protected static function addStoredDataInternal(array $fields)
522 {
523 return Internals\OrderDiscountDataTable::add($fields);
524 }
525
533 protected static function updateStoredDataInternal($id, array $fields)
534 {
535 return Internals\OrderDiscountDataTable::update($id, $fields);
536 }
537
543 protected static function getStoredDataTableInternal()
544 {
546 }
547
548 /* data storage end */
549}
$hash
Определения ajax_redirector.php:8
$type
Определения options.php:106
static isValidCouponType($couponType)
Определения discountcoupon.php:986
static prepareDiscountData($discount)
Определения orderdiscount.php:251
static clearList($discount)
Определения orderdiscount.php:354
static getEmptyFields($discount)
Определения orderdiscount.php:281
static calculateHash($discount)
Определения orderdiscount.php:197
static saveOrderDiscountModules($discountId, $moduleList)
Определения orderdiscount.php:630
static clearByOrder($order)
Определения orderround.php:125
const ENTITY_TYPE_BASKET_ITEM
Определения orderround.php:42
static clearByOrder($order)
Определения orderdiscount.php:1075
const STORAGE_TYPE_ORDER_CONFIG
Определения orderdiscountbase.php:22
static getResultEntityFromInternal($entity)
Определения orderdiscountbase.php:1932
static getResultEntityInternal($entity)
Определения orderdiscountbase.php:1921
static getRoundEntityInternal($entity)
Определения orderdiscountbase.php:2155
const STORAGE_TYPE_ROUND_CONFIG
Определения orderdiscountbase.php:23
static getRoundEntityFromInternal($entity)
Определения orderdiscountbase.php:2166
const STORAGE_TYPE_DISCOUNT_ACTION_DATA
Определения orderdiscountbase.php:21
const STORAGE_TYPE_BASKET_ITEM
Определения orderdiscountbase.php:24
static addRoundResultInternal(array $fields)
Определения orderdiscount.php:447
static getOrderDiscountIterator(array $parameters)
Определения orderdiscount.php:91
static getResultIterator(array $parameters)
Определения orderdiscount.php:268
static getRoundResultIterator(array $parameters)
Определения orderdiscount.php:434
static addResultInternal(array $fields)
Определения orderdiscount.php:336
static getOrderDiscountModuleIterator(array $parameters)
Определения orderdiscount.php:176
static updateResultInternal($id, array $fields)
Определения orderdiscount.php:359
static getResultTableNameInternal()
Определения orderdiscount.php:291
static addResultDescriptionInternal(array $fields)
Определения orderdiscount.php:347
static getResultDescriptionTableNameInternal()
Определения orderdiscount.php:301
static getDiscountIterator(array $parameters)
Определения orderdiscount.php:61
static addStoredDataInternal(array $fields)
Определения orderdiscount.php:521
static addOrderDiscountInternal(array $fields)
Определения orderdiscount.php:102
static checkResultTableWhiteList(array $fields)
Определения orderdiscount.php:312
static getOrderCouponIterator(array $parameters)
Определения orderdiscount.php:152
static checkRequiredOrderDiscountFields(array $fields)
Определения orderdiscount.php:113
static isValidCouponTypeInternal($type)
Определения orderdiscount.php:76
static updateResultDescriptionInternal($id, array $fields)
Определения orderdiscount.php:371
static calculateOrderDiscountHashInternal(array $fields)
Определения orderdiscount.php:136
static updateStoredDataInternal($id, array $fields)
Определения orderdiscount.php:533
static updateRoundResultInternal($id, array $fields)
Определения orderdiscount.php:459
static getStorageTypeInternal($storageType)
Определения orderdiscount.php:484
static checkResultDescriptionTableWhiteList(array $fields)
Определения orderdiscount.php:324
static validateCoupon(array $fields)
Определения orderdiscount.php:45
static getResultDescriptionIterator(array $parameters)
Определения orderdiscount.php:281
static deleteByOrder($order)
Определения orderdiscount.php:18
static saveOrderDiscountModulesInternal($orderDiscountId, array $modules)
Определения orderdiscount.php:188
static getStoredDataTableInternal()
Определения orderdiscount.php:543
static getRoundTableNameInternal()
Определения orderdiscount.php:469
static addOrderCouponInternal(array $fields)
Определения orderdiscount.php:163
static getStoredDataIterator(array $parameters)
Определения orderdiscount.php:510
static getRegistryType()
Определения orderdiscount.php:34
static normalizeOrderDiscountFieldsInternal(array $rawFields)
Определения orderdiscount.php:124
const REGISTRY_TYPE_ORDER
Определения registry.php:16
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$entity
$modules
Определения bitrix.php:26
$order
Определения payment.php:8
$fields
Определения yandex_run.php:501