/** * @param OrderBase $order * @return ShipmentCollection * @throws Main\ArgumentNullException */ public static function load(OrderBase $order) { /** @var ShipmentCollection $shipmentCollection */ $shipmentCollection = new static(); $shipmentCollection->setOrder($order); if ($order->getId() > 0) { $shipmentList = Shipment::loadForOrder($order->getId()); /** @var Shipment $shipment */ foreach ($shipmentList as $shipment) { $shipment->setCollection($shipmentCollection); $shipmentCollection->addItem($shipment); } } return $shipmentCollection; }