• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/urlrewriter.php
  • Класс: BitrixMainUrlRewriter
  • Вызов: UrlRewriter::getList
static function getList($siteId, $arFilter = array(), $arOrder = array())
{
	if (empty($siteId))
		throw new ArgumentNullException("siteId");

	$arUrlRewrite = static::loadRules($siteId);

	$arResult = array();
	$arResultKeys = self::filterRules($arUrlRewrite, $arFilter);
	foreach ($arResultKeys as $key)
		$arResult[] = $arUrlRewrite[$key];

	if (!empty($arOrder) && !empty($arResult))
	{
		$arOrderKeys = array_keys($arOrder);
		$orderBy = array_shift($arOrderKeys);
		$orderDir = $arOrder[$orderBy];

		$orderBy = mb_strtoupper($orderBy);
		$orderDir = mb_strtoupper($orderDir);

		$orderDir = (($orderDir == "DESC") ? SORT_DESC : SORT_ASC);

		$ar = array();
		foreach ($arResult as $key => $row)
			$ar[$key] = $row[$orderBy];

		array_multisort($ar, $orderDir, $arResult);
	}

	return $arResult;
}