<?php
namespace App\Controller\Front;
use App\Entity\LegalNotice;
use App\Service\AccessClientService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Doctrine\ORM\EntityManagerInterface;
class LegalNoticeController extends AbstractController
{
/**
* @Route("/legal-notice", name="app_front_legal_notice")
*/
public function legalNotice(AccessClientService $accessClientService, EntityManagerInterface $entityManager): Response
{
$accessClientService->handleAccessControl();
$legalNotices = $entityManager->getRepository(LegalNotice::class)->findBy([], ['id' => 'ASC']);
return $this->render('front/legal_notice/legal_notice.html.twig', [
'legalNotices' => $legalNotices
]);
}
}