Entity/BaseOrder.php
public function addShipment(Shipment $shipment)
    {
        $this->shipments[] = $shipment;
        $shipment->setOrder($this);
        if ($this->getShippingMethod()) {
            $shipment->setShippingMethod($this->getShippingMethod());
        }
        $this->mustRecalculShipments = true;

        return $this;
    }
public function addShipment(Shipment $shipment)
    {
        $this->shipments[] = $shipment;
        $shipment->setOrder($this);
        if ($this->getShippingMethod()) {
            $shipment->setShippingMethod($this->getShippingMethod());
        }
        $this->mustRecalculShipments = true;

        return $this;
    }
@param Shipment $shipment

@return BaseOrder