src/Controller/PromotionDetailController.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\Interfaces\PromotionRepositoryInterface;
  4. use WAM\Bundle\CoreBundle\Controller\Traits\RendererControllerTrait;
  5. use WAM\Bundle\CoreBundle\Util\Interfaces\RendererAwareInterface;
  6. /**
  7.  * @author Gerard Rico <grico@wearemarketing.com>
  8.  */
  9. class PromotionDetailController implements RendererAwareInterface
  10. {
  11.     use RendererControllerTrait;
  12.     private PromotionRepositoryInterface $promotionRepository;
  13.     public function __construct(PromotionRepositoryInterface $promotionRepository)
  14.     {
  15.         $this->promotionRepository $promotionRepository;
  16.     }
  17.     public function __invoke($contentDocument)
  18.     {
  19.         $relatedPromotions $this->promotionRepository->getRelated($contentDocument);
  20.         return $this->render(
  21.             'default/promotions_detail.html.twig',
  22.             [
  23.                 'promotion' => $contentDocument,
  24.                 'relatedPromotions' => $relatedPromotions,
  25.             ]
  26.         );
  27.     }
  28. }