• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/internals/orderdiscount.php
  • Класс: BitrixSaleInternalsOrderDiscountDataTable
  • Вызов: OrderDiscountDataTable::clearByDiscount
static function clearByDiscount($discountList)
{
	if (!is_array($discountList))
		$discountList = array($discountList);
	if (empty($discountList))
		return false;
	MainTypeCollection::normalizeArrayValuesByInt($discountList, true);
	if (empty($discountList))
		return false;

	$conn = MainApplication::getConnection();
	$helper = $conn->getSqlHelper();
	$conn->queryExecute(
		'delete from '.$helper->quote(self::getTableName()).
		' where '.$helper->quote('ENTITY_TYPE').' = '.self::ENTITY_TYPE_DISCOUNT.
		' and '.$helper->quote('ENTITY_ID').' in ('.implode(',', $discountList).')'
	);
	unset($helper, $conn);

	return true;
}