• Модуль: salescenter
  • Путь к файлу: ~/bitrix/modules/salescenter/lib/controller/order.php
  • Класс: BitrixSalesCenterControllerOrder
  • Вызов: Order::getAddressId
private function getAddressId(int $shipmentId, string $attribute)
{
	$shipment = SaleRepositoryShipmentRepository::getInstance()->getById($shipmentId);

	/** @var BitrixSalePropertyValue $propValue */
	$propValue = $shipment->getPropertyCollection()->getAttribute($attribute);
	if (!$propValue)
	{
		return null;
	}

	$addressArray = $propValue->getValue();
	if (!is_array($addressArray))
	{
		return null;
	}

	return (int)$addressArray['id'];
}