• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/calllist/item.php
  • Класс: Bitrix\Crm\CallList\Item
  • Вызов: Item::compare
public function compare(Item $other)
{
	static $statusIndex = null;
	if(is_null($statusIndex))
	{
		$statusList = CallList::getStatusList();
		foreach ($statusList as $statusRecord)
		{
			$statusIndex[$statusRecord['STATUS_ID']] = $statusRecord['SORT'];
		}
	}

	$myStatusSort = $statusIndex[$this->getStatusId()];
	$otherStatusSort = $statusIndex[$other->getStatusId()];
	$result = $otherStatusSort - $myStatusSort;

	return ($result == 0) ? $other->getRank() - $this->getRank() : $result;
}