• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/delivery/services/manager.php
  • Класс: BitrixSaleDeliveryServicesManager
  • Вызов: Manager::getRestrictionObject
static function getRestrictionObject($className)
{
	if(!class_exists($className))
		throw new SystemException("Can't find class: ".$className);

	static $cache = array();

	if(isset($cache[$className]))
		return $cache[$className];

	$restriction = new $className;

	if(!is_subclass_of($className, 'BitrixSaleServicesBaseRestriction'))
		throw new SystemException('Object must be the instance of BitrixSaleServicesBaseRestriction');

	$cache[$className] = $restriction;
	return  $restriction;
}