src/Controller/MenorcaDestinationController.php line 33

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\Interfaces\HotelRepositoryInterface;
  4. use App\Repository\Interfaces\PromotionRepositoryInterface;
  5. use WAM\Bundle\CoreBundle\Controller\Traits\RendererControllerTrait;
  6. use WAM\Bundle\CoreBundle\Util\Interfaces\RendererAwareInterface;
  7. use WAM\Bundle\RoutingBundle\Entity\Interfaces\UrlInterface;
  8. /**
  9.  * @author Alexandru Ilies <ailies@wearemarketing.com>
  10.  */
  11. class MenorcaDestinationController implements RendererAwareInterface
  12. {
  13.     use RendererControllerTrait;
  14.     private HotelRepositoryInterface $hotelRepository;
  15.     public function __construct(
  16.         HotelRepositoryInterface $hotelRepository
  17.     ) {
  18.         $this->hotelRepository $hotelRepository;
  19.     }
  20.     public function __invoke(UrlInterface $contentDocument)
  21.     {
  22.         $hotels $this->hotelRepository->getByCity("menorca");
  23.         return $this->render(
  24.             'default/menorca_destination.html.twig',
  25.             [
  26.                 'hotels' => $hotels,
  27.                 'url' => $contentDocument
  28.             ]
  29.         );
  30.     }
  31. }