• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/services/base/restrictionmanager.php
  • Класс: BitrixSaleServicesBaseRestrictionManager
  • Вызов: RestrictionManager::getRestrictionsList
static function getRestrictionsList($serviceId)
{
	if ((int)$serviceId <= 0)
		return array();

	$serviceType = static::getServiceType();

	if (!isset(static::$cachedFields[$serviceType]))
	{
		$result = array();
		$dbRes = ServiceRestrictionTable::getList(array(
			'filter' => array(
				'=SERVICE_TYPE' => $serviceType,
			),
			'order' => array('SORT' => 'ASC'),
		));

		while($restriction = $dbRes->fetch())
		{
			if (!isset($result[$restriction['SERVICE_ID']]))
				$result[$restriction['SERVICE_ID']] = array();

			$result[$restriction['SERVICE_ID']][$restriction["ID"]] = $restriction;
		}

		static::$cachedFields[$serviceType] = $result;
	}

	if (!isset(static::$cachedFields[$serviceType][$serviceId]))
		return array();

	return static::$cachedFields[$serviceType][$serviceId];
}