/** * @param string $comment * @param \inklabs\kommerce\EntityDTO\OrderItemQtyDTO $orderItemQtyDTO * @param ShipmentTracker $shipmentTracker * @param Order $order */ private function addShipment($comment, OrderItemQtyDTO $orderItemQtyDTO, ShipmentTracker $shipmentTracker, Order $order) { $shipment = new Shipment(); $shipmentTracker->setShipment($shipment); if ($comment !== '') { new ShipmentComment($shipment, $comment); } $this->addShipmentItemsFromOrderItems($orderItemQtyDTO, $shipment); $order->addShipment($shipment); $this->update($order); }