• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/repository/shipmentrepository.php
  • Класс: BitrixSaleRepositoryShipmentRepository
  • Вызов: ShipmentRepository::getByRow
private function getByRow(array $shipmenRow): ?SaleShipment
{
	$orderClassName = SaleRegistry::getInstance(SaleRegistry::REGISTRY_TYPE_ORDER)->getOrderClassName();

	/** @var SaleOrder $orderClassName */
	$order = $orderClassName::load($shipmenRow['ORDER_ID']);
	if ($order === null)
	{
		return null;
	}

	$shipmentCollection = $order->getShipmentCollection();

	/** @var BitrixSaleShipment $shipment */
	foreach ($shipmentCollection as $shipment)
	{
		if ($shipment->getId() !== (int)$shipmenRow['ID'])
		{
			continue;
		}

		return $shipment;
	}

	return null;
}