• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/orderdiscountbase.php
  • Класс: BitrixSaleOrderDiscountBase
  • Вызов: OrderDiscountBase::searchDiscount
static function searchDiscount($hash)
{
	$hash = (string)$hash;
	if ($hash === '')
		return null;
	$entity = get_called_class();
	if (!isset(self::$discountCache[$entity]))
		self::$discountCache[$entity] = array();
	if (!isset(self::$discountCache[$entity][$hash]))
	{
		$iterator = static::getOrderDiscountIterator(array(
			'select' => array('*'),
			'filter' => array('=DISCOUNT_HASH' => $hash)
		));
		$row = $iterator->fetch();
		if (!empty($row))
			self::setCacheItem($entity, $row);
		unset($row, $iterator);
	}

	return (isset(self::$discountCache[$entity][$hash]) ? self::$discountCache[$entity][$hash] : null);
}