src/Controller/AsturiasDestinationController.php line 32

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