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

	$statusMap = [
		Sale\Delivery\Requests\Manager::EXTERNAL_STATUS_SEMANTIC_SUCCESS => Tag::TYPE_SUCCESS,
		Sale\Delivery\Requests\Manager::EXTERNAL_STATUS_SEMANTIC_PROCESS => Tag::TYPE_WARNING,
	];
	$hasStatus = (
		$deliveryRequest['EXTERNAL_STATUS']
		&& $deliveryRequest['EXTERNAL_STATUS_SEMANTIC']
		&& isset($statusMap[$deliveryRequest['EXTERNAL_STATUS_SEMANTIC']])
	);
	if (!$hasStatus)
	{
		return null;
	}

	return [
		'status' => new Tag(
			$deliveryRequest['EXTERNAL_STATUS'],
			$statusMap[$deliveryRequest['EXTERNAL_STATUS_SEMANTIC']]
		),
	];
}