Promociones
This commit is contained in:
@ -10,10 +10,20 @@ use Incoviba\Service;
|
||||
|
||||
class Promotions extends Ideal\Controller
|
||||
{
|
||||
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, View $view, Service\Venta\Promotion $promotionService): ResponseInterface
|
||||
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, View $view,
|
||||
Service\Venta\Promotion $promotionService): ResponseInterface
|
||||
{
|
||||
$promotions = $promotionService->getAll('description');
|
||||
|
||||
return $view->render($response, 'ventas.promotions', ['promotions' => $promotions]);
|
||||
}
|
||||
public function show(ServerRequestInterface $request, ResponseInterface $response, View $view,
|
||||
Service\Venta\Promotion $promotionService, int $promotion_id): ResponseInterface
|
||||
{
|
||||
$promotion = null;
|
||||
try {
|
||||
$promotion = $promotionService->getById($promotion_id);
|
||||
} catch (ServiceAction\Read) {}
|
||||
return $view->render($response, 'ventas.promotions.show', ['promotion' => $promotion]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user