• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Timeline/Repository.php
  • Класс: Bitrix\Crm\Service\Timeline\Repository
  • Вызов: Repository::sortItems
protected function sortItems(array &$items): void
{
	usort($items, function ($a, $b) {
		$aSort = $a->getSort();
		$bSort = $b->getSort();

		foreach ($aSort as $index => $aValue)
		{
			$bValue = $bSort[$index] ?? 0;

			if ($aValue === $bValue)
			{
				continue;
			}

			return $aValue - $bValue;
		}

		return 0;
	});
}