From 08f84314073d6d8aa3b4fab3acc91dd0a167e0c7 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 15 Jul 2018 16:20:06 +0200 Subject: [PATCH] Added error message --- src/controller/order/Order.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controller/order/Order.php b/src/controller/order/Order.php index 183127b..683fd94 100644 --- a/src/controller/order/Order.php +++ b/src/controller/order/Order.php @@ -45,7 +45,11 @@ final class Order extends AbstractDefaultController implements OrderInterface private function store(): void { $this->core->getBasket()->setCustomer($this->core->getUser()); - $this->core->setBasket(new OrderEntity()); + if($this->orderRepository->saveOrder($this->core->getBasket())){ + $this->core->setBasket(new OrderEntity()); + }else{ + throw new \Exception('Order could not be saved!'); + } } public function basket(): void