<?php
namespace App\Controller\Front;
use App\Entity\{Help, Faq, FaqCategory};
use App\Service\AccessClientService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Doctrine\ORM\EntityManagerInterface;
class HelpFaqController extends AbstractController
{
/**
* @Route("/help-faq", name="app_front_help_faq")
*/
public function helpFAQ(AccessClientService $accessClientService, EntityManagerInterface $entityManager): Response
{
$accessClientService->handleAccessControl();
$help = $entityManager->getRepository(Help::class)->findOneBy([], ['id' => 'DESC']);
$faqCategory = $entityManager->getRepository(FaqCategory::class)->findBy([], ['id' => 'ASC']);
return $this->render('front/help_faq/help_faq.html.twig', [
'help' => $help,
'faqCategory' => $faqCategory
]);
}
}