mirror of
https://github.com/kevinveenbirkenbach/coding-challenge-online-shop.git
synced 2025-09-09 11:27:13 +02:00
Optimized order repository and implemented tests
This commit is contained in:
@@ -65,6 +65,8 @@ final class Order extends AbstractDefaultController implements OrderInterface
|
||||
$this->core->getBasket()->setCustomer($this->core->getUser());
|
||||
if($this->orderRepository->saveOrder($this->core->getBasket())){
|
||||
$this->core->setBasket(new OrderEntity());
|
||||
}else{
|
||||
throw new \Exception('Order could not be saved!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user