/** * @internal * @param Shipment $parentShipment * @param Shipment $childShipment * @return Result * @throws Main\ArgumentOutOfRangeException */ public function cloneShipment(Shipment $parentShipment, Shipment $childShipment) { foreach (static::getClonedFields() as $fieldName) { /** @var Result $r */ $childShipment->setFieldNoDemand($fieldName, $parentShipment->getField($fieldName)); } $childShipment->setExtraServices($parentShipment->getExtraServices()); $childShipment->setStoreId($parentShipment->getStoreId()); return new Result(); }