- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/internals/orderdiscount.php
- Класс: BitrixSaleInternalsOrderDiscountTable
- Вызов: OrderDiscountTable::clearList
static function clearList($discount)
{
if (!is_array($discount))
$discount = array($discount);
MainTypeCollection::normalizeArrayValuesByInt($discount, true);
if (empty($discount))
return;
$conn = MainApplication::getConnection();
$helper = $conn->getSqlHelper();
$discountRows = array_chunk($discount, 500);
$query = 'delete from '.$helper->quote(self::getTableName()).' where '.$helper->quote('ID');
foreach ($discountRows as &$row)
{
$conn->queryExecute($query.' in ('.implode(', ', $row).')');
OrderModulesTable::clearByDiscount($row);
}
unset($row, $query, $discountRows, $helper, $conn);
}