<?php
namespace App\Controller;
use App\Repository\Interfaces\HotelRepositoryInterface;
use App\Repository\Interfaces\PromotionRepositoryInterface;
use WAM\Bundle\CoreBundle\Controller\Traits\RendererControllerTrait;
use WAM\Bundle\CoreBundle\Util\Interfaces\RendererAwareInterface;
use WAM\Bundle\RoutingBundle\Entity\Interfaces\UrlInterface;
/**
* @author Alexandru Ilies <ailies@wearemarketing.com>
*/
class MenorcaDestinationController implements RendererAwareInterface
{
use RendererControllerTrait;
private HotelRepositoryInterface $hotelRepository;
public function __construct(
HotelRepositoryInterface $hotelRepository
) {
$this->hotelRepository = $hotelRepository;
}
public function __invoke(UrlInterface $contentDocument)
{
$hotels = $this->hotelRepository->getByCity("menorca");
return $this->render(
'default/menorca_destination.html.twig',
[
'hotels' => $hotels,
'url' => $contentDocument
]
);
}
}