mirror of
https://github.com/kevinveenbirkenbach/coding-challenge-online-shop.git
synced 2024-11-26 03:51:06 +01:00
Added error message
This commit is contained in:
parent
244b18a42f
commit
08f8431407
@ -45,7 +45,11 @@ final class Order extends AbstractDefaultController implements OrderInterface
|
|||||||
private function store(): void
|
private function store(): void
|
||||||
{
|
{
|
||||||
$this->core->getBasket()->setCustomer($this->core->getUser());
|
$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
|
public function basket(): void
|
||||||
|
Loading…
Reference in New Issue
Block a user