Skip to content

Commit

Permalink
Merge branch 'master' into vtk-master
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiddons committed Nov 4, 2024
2 parents 3679a38 + 2a8ac07 commit 4ee18c8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions module/ShopBundle/Controller/ShopController.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,25 +232,29 @@ public function consumeAction()
}

if (count($reservations) === 0) {
$this->flashMessenger()->error(
'Error',
$this->getTranslator()->translate('No reservations were found for the provided username.')
);
return new ViewModel(
array(
'noEntity' => 'No consumptions were found',
'form' => $this->getForm('shop_shop_consume'),
'form' => $form,
'session' => $salesSession,
)
);
} else {
$consumed = $reservations[0]->getConsumed();
foreach ($reservations as $reservation) {
$reservation->setConsumed(true);
}
$this->getEntityManager()->flush(); // Sends cache to database
$this->getEntityManager()->flush(); // Sends cache to database

return new ViewModel(
array(
'reservations' => $reservations,
'consumed' => $consumed,
'form' => $form,
'session' => $salesSession,
'consumed' => $consumed,
'form' => $form,
'session' => $salesSession,
)
);
}
Expand All @@ -259,7 +263,7 @@ public function consumeAction()
return new ViewModel(
array(
'session' => $salesSession,
'form' => $form,
'form' => $form,
)
);
}
Expand Down

0 comments on commit 4ee18c8

Please sign in to comment.