DiscountRestrictionTable::changeActiveByDiscount

  1. Bitrix24 API (v. 23.675.0)
  2. catalog
  3. DiscountRestrictionTable
  4. changeActiveByDiscount
  • Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/discountrestriction.php
  • Класс: BitrixCatalogDiscountRestrictionTable
  • Вызов: DiscountRestrictionTable::changeActiveByDiscount
static function changeActiveByDiscount($discount, $active)
{
	$discount = (int)$discount;
	$active = (string)$active;
	if ($discount <= 0 || ($active != 'Y' && $active != 'N'))
		return;
	$conn = MainApplication::getConnection();
	$helper = $conn->getSqlHelper();
	$conn->queryExecute(
		'update '.$helper->quote(self::getTableName()).
		' set '.$helper->quote('ACTIVE').' = ''.$active.'' where '.
		$helper->quote('DISCOUNT_ID').' = '.$discount
	);
	unset($helper, $conn);
}

Добавить комментарий