• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/component/elementlist.php
  • Класс: BitrixIblockComponentElementList
  • Вызов: ElementList::getCustomSort
protected function getCustomSort(): array
{
	$result = [];

	if (!empty($this->arParams['CUSTOM_ELEMENT_SORT']) && is_array($this->arParams['CUSTOM_ELEMENT_SORT']))
	{
		foreach ($this->arParams['CUSTOM_ELEMENT_SORT'] as $field => $value)
		{
			$field = strtoupper($field);
			if (isset($result[$field]))
			{
				continue;
			}
			if ($field === 'ID' && !empty($value) && is_array($value))
			{
				Collection::normalizeArrayValuesByInt($value, false);
				if (empty($value))
				{
					continue;
				}
			}
			else
			{
				if (!is_string($value))
				{
					continue;
				}
				if (!preg_match(self::SORT_ORDER_MASK, $value))
				{
					continue;
				}
			}

			$result[$field] = $value;
		}
		unset($field, $value);
	}

	return $result;
}