feat: filtering of custom destinations by hotel

This commit is contained in:
Björn Fromme
2025-07-22 17:42:06 +02:00
parent ea574427fb
commit e0ce495b86
8 changed files with 233 additions and 1 deletions
@@ -3,6 +3,7 @@
namespace App\Controller\Administrative\System\Destination;
use App\Repository\DestinationRepository;
use App\Service\Common\DestinationFilterHandler;
use Knp\Component\Pager\PaginatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
@@ -15,6 +16,7 @@ class IndexController extends AbstractController
public function __construct(
private readonly DestinationRepository $destinationRepository,
private readonly PaginatorInterface $paginator,
private readonly DestinationFilterHandler $filterHandler
) {
}
@@ -22,9 +24,11 @@ class IndexController extends AbstractController
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(Request $request): Response
{
$filterDto = $this->filterHandler->getFilterSettings();
$query = $this
->destinationRepository
->getListQueryForCustom()
->getListQuery($filterDto)
;
$pagination = $this->paginator->paginate(
@@ -39,6 +43,7 @@ class IndexController extends AbstractController
return $this->render('administrative/system/destination/index.html.twig', [
'pagination' => $pagination,
'filterDto' => $filterDto,
]);
}
}