• Модуль: lists
  • Путь к файлу: ~/bitrix/modules/lists/lib/rest/restservice.php
  • Класс: BitrixListsRestRestService
  • Вызов: RestService::getSection
static function getSection(array $params, $n, CRestServer $server)
{
	$param = new Param($params);
	$params = $param->getParams();

	global $USER;
	$rightParam = new RightParam($param);
	$rightParam->setUser($USER);
	$rightParam->setEntityId($params["IBLOCK_SECTION_ID"]);

	if (!CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
	{
		throw new AccessException('Available only on extended plans');
	}

	$right = new Right($rightParam, new SectionRight($rightParam));
	$right->checkPermission(SectionRight::READ);
	if ($right->hasErrors())
	{
		self::throwError($right->getErrors());
	}

	$section = new Section($param);
	list ($sections, $queryObject) = $section->get(self::getNavData($n));
	if (empty($sections) || $section->hasErrors())
	{
		return [];
	}
	else
	{
		return self::setNavData(array_values($sections), $queryObject);
	}
}