• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Timeline/Item/Activity.php
  • Класс: Bitrix\Crm\Service\Timeline\Item\Activity
  • Вызов: Activity::getSort
public function getSort(): array
{
	if (!$this->getModel()->isScheduled())
	{
		return parent::getSort();
	}

	if ($this->isIncomingChannel())
	{
		// incoming channel activities have a negative timestamp because they must be first in the list
		// and must be sorted in reverse order:
		return [
			$this->getDate()
				? -(int)$this->getDate()->getTimestamp()
				: 0,
			$this->getActivityId()
		];
	}

	return [
		$this->getDeadline()
			? (int)$this->getDeadline()->getTimestamp()
			: PHP_INT_MAX,
		$this->getActivityId()
	];
}