• Модуль: crmmobile
  • Путь к файлу: ~/bitrix/modules/crmmobile/lib/ProductGrid/Enricher/CompleteBasketFields.php
  • Класс: BitrixCrmMobileProductGridEnricherCompleteBasketFields
  • Вызов: CompleteBasketFields::getOrderId
private function getOrderId(): ?int
{
	$relation = Container::getInstance()->getRelationManager()
		->getRelation(
			new RelationIdentifier(
				$this->entity->getEntityTypeId(),
				CCrmOwnerType::Order
			)
		)
	;
	if (!$relation)
	{
		return null;
	}

	$result = null;

	$orderIdentifiers = $relation->getChildElements(
		new ItemIdentifier(
			$this->entity->getEntityTypeId(),
			$this->entity->getId()
		)
	);
	foreach ($orderIdentifiers as $orderIdentifier)
	{
		$result = $orderIdentifier->getEntityId();
	}

	return $result;
}