Skip to content

Commit 6d2152f

Browse files
committed
ACP2E-2213: Loading order through repository loads the order multiple times from DB
1 parent 76c7aa4 commit 6d2152f

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

app/code/Magento/Sales/Model/OrderRepository.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -312,29 +312,11 @@ private function setShippingAssignments(OrderInterface $order)
312312
} elseif ($extensionAttributes->getShippingAssignments() !== null) {
313313
return;
314314
}
315-
/** @var ShippingAssignmentInterface $shippingAssignment */
316-
$shippingAssignments = $this->getShippingAssignmentBuilderDependency();
317-
$shippingAssignments->setOrder($order);
318-
$extensionAttributes->setShippingAssignments($shippingAssignments->create());
315+
$this->shippingAssignmentBuilder->setOrder($order);
316+
$extensionAttributes->setShippingAssignments($this->shippingAssignmentBuilder->create());
319317
$order->setExtensionAttributes($extensionAttributes);
320318
}
321319

322-
/**
323-
* Get the new ShippingAssignmentBuilder dependency for application code
324-
*
325-
* @return ShippingAssignmentBuilder
326-
* @deprecated 100.0.4
327-
*/
328-
private function getShippingAssignmentBuilderDependency()
329-
{
330-
if (!$this->shippingAssignmentBuilder instanceof ShippingAssignmentBuilder) {
331-
$this->shippingAssignmentBuilder = \Magento\Framework\App\ObjectManager::getInstance()->get(
332-
\Magento\Sales\Model\Order\ShippingAssignmentBuilder::class
333-
);
334-
}
335-
return $this->shippingAssignmentBuilder;
336-
}
337-
338320
/**
339321
* Helper function that adds a FilterGroup to the collection.
340322
*

0 commit comments

Comments
 (0)