Skip to content

Commit

Permalink
[framework] upgraded doctrine/orm to latest version (#2774)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasLudvik authored Sep 12, 2023
1 parent 9ff7fa0 commit b3a61da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@
"docker": false
}
},
"conflict": {
"doctrine/orm": "2.12.0 || >=2.16.0"
},
"suggest": {
"ext-pgsql": "Required for dumping the Postgres database in shopsys:database:dump command"
},
Expand Down
1 change: 1 addition & 0 deletions src/Model/Order/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ public function __construct(
$this->createdAsAdministratorName = $orderData->createdAsAdministratorName;
$this->origin = $orderData->origin;
$this->uuid = $orderData->uuid ?: Uuid::uuid4()->toString();
$this->setTotalPrice(new OrderTotalPrice(Money::zero(), Money::zero(), Money::zero()));
}

/**
Expand Down
8 changes: 3 additions & 5 deletions src/Model/Order/OrderFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,15 @@ public function createOrder(OrderData $orderData, OrderPreview $orderPreview, ?C
$customerUser,
);

$this->fillOrderItems($order, $orderPreview);
$this->em->persist($order);
$this->em->flush();

foreach ($order->getItems() as $orderItem) {
$this->em->persist($orderItem);
}
$this->fillOrderItems($order, $orderPreview);

$order->setTotalPrice(
$this->orderPriceCalculation->getOrderTotalPrice($order),
);

$this->em->persist($order);
$this->em->flush();

return $order;
Expand Down

0 comments on commit b3a61da

Please sign in to comment.