src/Controller/WebsiteController.php line 316

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Actualite;
  4. use App\Entity\Article;
  5. use App\Entity\Blog;
  6. use App\Entity\CategorieRealisation;
  7. use App\Entity\ChatAssistant;
  8. use App\Entity\Client;
  9. use App\Entity\CompositionAccueil;
  10. use App\Entity\Compteur;
  11. use App\Entity\Cookies;
  12. use App\Entity\Emplacement;
  13. use App\Entity\General;
  14. use App\Entity\HorairesDouverture;
  15. use App\Entity\IconesColorees;
  16. use App\Entity\Image;
  17. use App\Entity\ImagesAccueil;
  18. use App\Entity\MentionsLegales;
  19. use App\Entity\Menu;
  20. use App\Entity\MenuActions;
  21. use App\Entity\NosChiffresCles;
  22. use App\Entity\NosGaranties;
  23. use App\Entity\PolitiqueDeConfidentialite;
  24. use App\Entity\Presentation;
  25. use App\Entity\QuiSommesNous;
  26. use App\Entity\Realisation;
  27. use App\Entity\ReseauxSociaux;
  28. use App\Entity\SectionIconeColoree;
  29. use App\Entity\SectionZoneDintervention;
  30. use App\Entity\Service;
  31. use App\Entity\Tarif;
  32. use App\Entity\Temoignage;
  33. use App\Entity\User;
  34. use App\Repository\ActualiteRepository;
  35. use App\Repository\ArticleRepository;
  36. use App\Repository\BlogRepository;
  37. use App\Repository\CategorieRealisationRepository;
  38. use App\Repository\ClientRepository;
  39. use App\Repository\CookiesRepository;
  40. use App\Repository\EmplacementRepository;
  41. use App\Repository\GeneralRepository;
  42. use App\Repository\ImagesAccueilRepository;
  43. use App\Repository\MentionsLegalesRepository;
  44. use App\Repository\NosGarantiesRepository;
  45. use App\Repository\PolitiqueDeConfidentialiteRepository;
  46. use App\Repository\RealisationRepository;
  47. use App\Repository\ServiceRepository;
  48. use App\Repository\TarifRepository;
  49. use App\Repository\TemoignageRepository;
  50. use Doctrine\ORM\EntityManagerInterface;
  51. use Exception;
  52. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  53. use Symfony\Bundle\FrameworkBundle\Console\Application;
  54. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  55. use Symfony\Component\Console\Input\ArrayInput;
  56. use Symfony\Component\Console\Output\NullOutput;
  57. use Symfony\Component\HttpFoundation\File\Exception\FileException;
  58. use Symfony\Component\HttpFoundation\File\UploadedFile;
  59. use Symfony\Component\HttpFoundation\JsonResponse;
  60. use Symfony\Component\HttpFoundation\RedirectResponse;
  61. use Symfony\Component\HttpFoundation\Request;
  62. use Symfony\Component\HttpFoundation\Response;
  63. use Symfony\Component\HttpKernel\KernelInterface;
  64. use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
  65. use Symfony\Component\Mailer\Mailer;
  66. use Symfony\Component\Mailer\MailerInterface;
  67. use Symfony\Component\Mime\Email;
  68. use Symfony\Component\Routing\Annotation\Route;
  69. use Symfony\Component\Serializer\SerializerInterface;
  70. use Symfony\Component\String\Slugger\AsciiSlugger;
  71. use Symfony\Component\Yaml\Yaml;
  72. class WebsiteController extends AbstractController
  73. {
  74. public const RELATIVE_PATH_TO_PROJECT_FOLDER = '../';
  75. /**
  76. * @Route("/", name="home")
  77. */
  78. public function home(NosGarantiesRepository $nosGarantiesRepository, GeneralRepository $generalRepository,RealisationRepository $realisationRepository, ArticleRepository $articleRepository, ActualiteRepository $actualiteRepository,ClientRepository $clientRepository,TemoignageRepository $temoignageRepository,ImagesAccueilRepository $imageAccueilRepository,ServiceRepository $serviceRepository): Response
  79. {
  80. $generalItem = $generalRepository->find(1);
  81. $realisations = $realisationRepository->findAll();
  82. $allActualites = $actualiteRepository->findAll();
  83. $allArticles = $articleRepository->findAll();
  84. $allClient = $clientRepository->findAll();
  85. $allTemoignages = $temoignageRepository->findAll();
  86. $allEngagements = $nosGarantiesRepository->findAll();
  87. $imagesAccueil = $imageAccueilRepository->find(1);
  88. $services = $serviceRepository->findBy([],['id' => 'DESC'],3);
  89. return $this->render('pages/home.html.twig', [
  90. "general" => $generalItem,
  91. 'realisations' => array_reverse($realisations),
  92. 'actualites' => array_reverse($allActualites),
  93. 'clients' => array_reverse($allClient),
  94. 'temoignages' => array_reverse($allTemoignages),
  95. 'articles' => array_reverse($allArticles),
  96. 'engagements' => $allEngagements,
  97. "imageAccueil" => $imagesAccueil,
  98. 'services' => $services
  99. ]);
  100. }
  101. /**
  102. * @Route("/realisations", name="realisations")
  103. */
  104. public function realisation(RealisationRepository $realisationRepository,ClientRepository $clientRepository,CategorieRealisationRepository $categorieRealisationRepository): Response
  105. {
  106. $realisations = $realisationRepository->findAll();
  107. $allClient = $clientRepository->findAll();
  108. $categoriesRealisations = $categorieRealisationRepository->findAll();
  109. return $this->render('pages/realisations.html.twig', [
  110. 'realisations' => $realisations,
  111. 'clients' => $allClient,
  112. 'categories' => $categoriesRealisations
  113. ]);
  114. }
  115. /**
  116. * @Route("/blogs", name="blogs")
  117. */
  118. public function blogs(BlogRepository $blogRepository, GeneralRepository $generalRepository): Response
  119. {
  120. $allBlogs = $blogRepository->findAll();
  121. $general = $generalRepository->find(1);
  122. $allBlogs = array_reverse($allBlogs);
  123. return $this->render('pages/blogs.html.twig', [
  124. 'blogs' => $allBlogs,
  125. 'general' => $general
  126. ]);
  127. }
  128. /**
  129. * @Route("/actualites", name="actualites")
  130. */
  131. public function articles(ArticleRepository $articleRepository, GeneralRepository $generalRepository): Response
  132. {
  133. $allArticles = $articleRepository->findAll();
  134. $general = $generalRepository->find(1);
  135. $allArticles = array_reverse($allArticles);
  136. return $this->render('pages/articles.html.twig', [
  137. 'articles' => $allArticles,
  138. 'general' => $general
  139. ]);
  140. }
  141. /**
  142. * @Route("/social", name="social")
  143. */
  144. public function actualites(ActualiteRepository $actualiteRepository): Response
  145. {
  146. $allActualites = $actualiteRepository->findAll();
  147. return $this->render('pages/social.html.twig', [
  148. 'actualites' => array_reverse($allActualites),
  149. ]);
  150. }
  151. /**
  152. * @Route("/cookies", name="cookies")
  153. */
  154. public function cookies(CookiesRepository $cookieRepo): Response
  155. {
  156. $cookie = $cookieRepo->find(1);
  157. return $this->render('pages/cookies.html.twig', [
  158. 'cookies' => $cookie,
  159. ]);
  160. }
  161. /**
  162. * @Route("/mentions-legales", name="mentionsLegales")
  163. */
  164. public function mentionsLegales(MentionsLegalesRepository $mentionsLegalesRepository): Response
  165. {
  166. $mentionsLegales = $mentionsLegalesRepository->find(1);
  167. return $this->render('pages/mentionsLegales.html.twig', [
  168. 'mentionsLegales' => $mentionsLegales,
  169. ]);
  170. }
  171. /**
  172. * @Route("/politique-de-confidentialite", name="politiqueDeConfidentialite")
  173. */
  174. public function politiqueDeConfidentialite(PolitiqueDeConfidentialiteRepository $PolitiqueDeConfidentialiteRepository): Response
  175. {
  176. $pdc = $PolitiqueDeConfidentialiteRepository->find(1);
  177. return $this->render('pages/pdc.html.twig', [
  178. 'pdc' => $pdc,
  179. ]);
  180. }
  181. /**
  182. * @Route("/blog/{id}", name="blog", methods={"GET"})
  183. */
  184. public function blog(BlogRepository $blogRepository, GeneralRepository $generalRepository,int $id): Response
  185. {
  186. $blog = $blogRepository->find($id);
  187. $general = $generalRepository->find(1);
  188. $nextBlog = $blogRepository->find($blog->getId() +1);
  189. $previousBlog = $blogRepository->find($blog->getId() -1);
  190. $otherBlogs = $blogRepository->findBy([],[],3);
  191. return $this->render('pages/blog.html.twig', [
  192. 'blog' => $blog,
  193. 'general' => $general,
  194. 'nextBlog' => $nextBlog,
  195. 'previousBlog' => $previousBlog,
  196. 'otherBlogs' => $otherBlogs
  197. ]);
  198. }
  199. /**
  200. * @Route("/actualite/{id}", name="actualite", methods={"GET"})
  201. */
  202. public function actualite(ArticleRepository $articleRepository, GeneralRepository $generalRepository,int $id): Response
  203. {
  204. $article = $articleRepository->find($id);
  205. $general = $generalRepository->find(1);
  206. $nextArticle = $articleRepository->find($article->getId() +1);
  207. $previousArticle = $articleRepository->find($article->getId() -1);
  208. $otherArticles = $articleRepository->findBy([],[],3);
  209. return $this->render('pages/article.html.twig', [
  210. 'article' => $article,
  211. 'general' => $general,
  212. 'nextArticle' => $nextArticle,
  213. 'previousArticle' => $previousArticle,
  214. 'otherArticles' => $otherArticles
  215. ]);
  216. }
  217. /**
  218. * @Route("/contact", name="contact")
  219. */
  220. public function contact(EmplacementRepository $emplacementRepository,Request $request,MailerInterface $mailer,GeneralRepository $repository): Response
  221. {
  222. if($request->isMethod('POST')){
  223. if($request->files->get('widget-contact-form-file')){
  224. /** @var UploadedFile $file */
  225. $file = $request->files->get('widget-contact-form-file');
  226. $originalFilename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);
  227. $slugger = new AsciiSlugger();
  228. // this is needed to safely include the file name as part of the URL
  229. $safeFilename = $slugger->slug($originalFilename);
  230. $newFilename = $safeFilename.'-'.uniqid().'.'.$file->guessExtension();
  231. try {
  232. $file->move(
  233. 'images/upload',
  234. $newFilename
  235. );
  236. } catch (FileException $e) {
  237. return new JsonResponse(['response' => 'danger','message' => 'Oups, une erreur est survenu pendant l\'envoi de votre fichier, tentez de nous contacter directement par mail.']);
  238. }
  239. };
  240. $name = $request->get('widget-contact-form-name');
  241. $mail = $request->get('widget-contact-form-email');
  242. $phone = $request->get('widget-contact-form-phone');
  243. $message = $request->get('widget-contact-form-message');
  244. $entrepriseName = $repository->find(1)->getNomEntreprise();
  245. $email = (new Email())
  246. ->from('do-not-reply@spidertec.fr')
  247. ->subject("[$entrepriseName] Nouveau message Client")
  248. ->html($this->renderView('email/contact.html.twig',[
  249. 'name' => $name,
  250. 'email' => $mail,
  251. 'message' => $message,
  252. 'phone' => $phone,
  253. 'entrepriseName' => $entrepriseName
  254. ]))
  255. ->to($repository->find(1)->getAdresseEmail());
  256. if(isset($file)){
  257. $email->attachFromPath("images/upload/$newFilename");
  258. }
  259. $email->ensureValidity();
  260. $mailer->send($email);
  261. return new JsonResponse(['response' => 'success',"message" => 'Message envoyé']);
  262. }
  263. else{
  264. $text = $request->get('text');
  265. $allEmplacements = $emplacementRepository->findAll();
  266. return $this->render('pages/contact.html.twig', [
  267. 'emplacements' => array_reverse($allEmplacements),
  268. 'text' => $text
  269. ]);
  270. }
  271. }
  272. /**
  273. * @Route("/tarifs" , name="tarifs")
  274. */
  275. public function tarifs(TarifRepository $tarifRepository){
  276. $allTarifs = $tarifRepository->findBy([],['id' => 'DESC']);
  277. return $this->render('pages/tarifs.html.twig',[
  278. 'tarifs' => $allTarifs
  279. ]);
  280. }
  281. /**
  282. * @Route("/services", name="services")
  283. */
  284. public function services(ServiceRepository $serviceRepository): Response
  285. {
  286. $allServices = $serviceRepository->findBy([],['id' => 'DESC']);
  287. return $this->render('pages/services.html.twig', [
  288. 'services' => $allServices,
  289. ]);
  290. }
  291. /**
  292. * @Route("/service/{id}", name="service", methods={"GET"})
  293. */
  294. public function service(ServiceRepository $serviceRepository, GeneralRepository $generalRepository,int $id): Response
  295. {
  296. $service = $serviceRepository->find($id);
  297. $general = $generalRepository->find(1);
  298. $nextService = $serviceRepository->find($service->getId() +1);
  299. $previousService = $serviceRepository->find($service->getId() -1);
  300. $otherServices = $serviceRepository->findBy([],[],3);
  301. return $this->render('pages/service.html.twig', [
  302. 'service' => $service,
  303. 'general' => $general,
  304. 'nextService' => $nextService,
  305. 'previousService' => $previousService,
  306. 'otherServices' => $otherServices
  307. ]);
  308. }
  309. /**
  310. * @Route("preview/service/{id}", name="preview-service")
  311. */
  312. public function previewService(Service $service,ServiceRepository $serviceRepository, GeneralRepository $generalRepository): Response
  313. {
  314. $general = $generalRepository->find(1);
  315. $nextService = $serviceRepository->find($service->getId() +1);
  316. $previousService = $serviceRepository->find($service->getId() -1);
  317. $otherServices = $serviceRepository->findBy([],[],3);
  318. return $this->render('composantsPages/homeComponents/preview/service.html.twig',[
  319. 'service' => $service,
  320. 'general' => $general,
  321. 'nextService' => $nextService,
  322. 'previousService' => $previousService,
  323. 'otherServices' => $otherServices]);
  324. }
  325. /**
  326. * @Route("qui-sommes-nous", name="page-qui-sommes-nous")
  327. */
  328. public function pageQuiSommesNous(){
  329. return $this->render('pages/quiSommesNous.html.twig');
  330. }
  331. /**
  332. * @Route("/admin/text-edit",name="text-edit")
  333. * @Route("/admin/text-edit/{slug}",name="text-edit-single")
  334. * @return Response
  335. */
  336. public function editText(string $slug = null, Request $request)
  337. {
  338. $data = Yaml::parseFile('../translations/messages.fr.yaml');
  339. if ($request->isMethod('POST')) {
  340. $trueData = [];
  341. $datas = $request->request->all();
  342. foreach ($datas as $singleLineKey => $value) {
  343. $accessors = explode('&', $singleLineKey);
  344. $this->setValueByArrayKeys($accessors, $trueData, $value);
  345. }
  346. $yaml = Yaml::dump($trueData);
  347. file_put_contents('../translations/messages.fr.yaml', $yaml);
  348. $data = Yaml::parseFile('../translations/messages.fr.yaml');
  349. if (!is_null($slug)) {
  350. return $this->redirect($request->headers->get('referer'));
  351. }
  352. }
  353. return $this->render('pages/text-edit_ajax.html.twig', [
  354. 'data' => $data,
  355. 'search' => $slug
  356. ]);
  357. }
  358. private function setValueByArrayKeys($array_keys, &$multi, $value)
  359. {
  360. $m = &$multi;
  361. foreach ($array_keys as $k) {
  362. if (!isset($m[$k])) {
  363. $m[$k] = null;
  364. }
  365. $m = &$m[$k];
  366. }
  367. $m = $value;
  368. }
  369. /**
  370. * @Route("/cc",name="cc")
  371. *
  372. */
  373. public function cc(Request $request,KernelInterface $kernel)
  374. {
  375. General::refreshColor();
  376. if($this->getUser()){
  377. if(in_array('ROLE_ADMIN',$this->getUser()->getRoles())){
  378. $application = new Application($kernel);
  379. $application->setAutoExit(false);
  380. $input = new ArrayInput(['command' => 'cache:clear']);
  381. $output = new NullOutput();
  382. $application->run($input, $output);
  383. return $this->redirect($request->headers->get('referer'));
  384. }
  385. }
  386. throw $this->createAccessDeniedException();
  387. }
  388. /**
  389. * @Route("/status.json",name="website_status")
  390. */
  391. public function getStatus(Request $request)
  392. {
  393. return new JsonResponse([
  394. 'server_name' => $_SERVER['SERVER_NAME'] ?? 'empty',
  395. 'server_ip' => $_SERVER['SERVER_ADDR'] ?? 'empty',
  396. 'dns_records' => dns_get_record($_SERVER['SERVER_NAME'])
  397. ],200,[
  398. 'Access-Control-Allow-Origin' => '*'
  399. ]);
  400. }
  401. /**
  402. * @Route("/mail-test", name="mail_test")
  403. * @param Request $request
  404. * @param GeneralRepository $repository
  405. * @param MailerInterface $mailer
  406. * @return Response
  407. */
  408. public function testEmail(Request $request,GeneralRepository $repository,MailerInterface $mailer) : Response
  409. {
  410. $email = (new Email())
  411. ->from($repository->find(1)->getAdresseEmail())
  412. ->subject("[".$_SERVER['SERVER_NAME']."] Message test de mail")
  413. ->html("Mail de test")
  414. ->to('test-spidertec@yopmail.com','cadarsir@gmail.com');
  415. try{
  416. $mailer->send($email);
  417. $this->addFlash('success','Envoi d\'email réussi');
  418. } catch (TransportExceptionInterface $e) {
  419. $this->addFlash('danger','Envoi d\'email échoué');
  420. }
  421. return $this->redirect($request->headers->get('referer'));
  422. }
  423. /**
  424. * @Route("/admin/urlset", name="url_api_add")
  425. */
  426. public function addSet(Request $request)
  427. {
  428. $this->checkClient($request->getClientIp());
  429. $sites = $this->getUrlSetContentFile();
  430. $filePath = self::RELATIVE_PATH_TO_PROJECT_FOLDER.$this->getParameter('sites_file');
  431. $preprod = $request->request->get('preprod');
  432. $preprod_mdp = $request->request->get('preprod_mdp');
  433. $prod = $request->request->get('prod');
  434. $prod_mdp = $request->request->get('prod_mdp');
  435. $name = ucfirst(str_replace('-',' ',$request->request->get('name','')));
  436. if($request->getMethod() == 'POST'){
  437. $toCreate = [];
  438. if(!empty($name))
  439. {
  440. $foundSite = $this->findSite($sites,$name);
  441. if(!is_null($foundSite)){
  442. return new Response("Site déjà existant.",401);
  443. }
  444. $toCreate['name'] = $name;
  445. if(!is_null($preprod)){
  446. $toCreate['preprod'] = $preprod;
  447. if(!is_null($preprod_mdp)){
  448. $toCreate['preprod_mdp'] = $preprod_mdp;
  449. }
  450. }
  451. if(!is_null($prod) && !is_null($prod_mdp)){
  452. $toCreate['prod'] = $prod;
  453. $toCreate['prod_mdp'] = $prod_mdp;
  454. }
  455. $sites[] = $toCreate;
  456. file_put_contents($filePath,json_encode($sites));
  457. return new JsonResponse($this->getUrlSetContentFile());
  458. }
  459. else{
  460. return new Response("Paramètres incorrects.",400);
  461. }
  462. }
  463. else{
  464. return new Response("//todo.",401);
  465. }
  466. }
  467. /**
  468. * @Route("/admin/urlset/get",name="url_api_get")
  469. * @param Request $request
  470. * @return JsonResponse
  471. */
  472. public function getUrlsSetContent(Request $request)
  473. {
  474. try{
  475. $this->denyAccessUnlessGranted('ROLE_ADMIN');
  476. $content = $this->getUrlSetContentFile();
  477. return new JsonResponse($content);
  478. }catch(Exception $e){
  479. return new JsonResponse([]);
  480. }
  481. }
  482. private function getUrlSetContentFile()
  483. {
  484. $sitesJsonEmplacement = $this->getParameter('sites_file');
  485. $filePath = self::RELATIVE_PATH_TO_PROJECT_FOLDER.$sitesJsonEmplacement;
  486. return json_decode(file_get_contents($filePath),true);
  487. }
  488. private function checkClient($ip){
  489. $authorizedIps = $this->getParameter('api_urlset_authorized_ips');
  490. if(!in_array($ip,$authorizedIps)){
  491. throw new Exception("Client non autorisé");
  492. }
  493. }
  494. private function findSite($sites,$name) : ?array
  495. {
  496. return array_values(array_filter($sites,function(array $site) use ($name){return $site['name'] == $name;}))[0] ?? null;
  497. }
  498. /**
  499. * @Route("/export", name="export")
  500. * @param EntityManagerInterface $em
  501. * @return void
  502. */
  503. public function export(EntityManagerInterface $em, SerializerInterface $serializer, Request $request) : Response
  504. {
  505. $key = $request->query->get('key');
  506. if($key != 'spidertecevolut'){
  507. return new Response("Exportation interdite.",401);
  508. }
  509. $websiteParameters = $em->getRepository(General::class)->findAll();
  510. $actualites = $em->getRepository(Actualite::class)->findAll();
  511. $articles = $em->getRepository(Article::class)->findAll();
  512. $blogs = $em->getRepository(Blog::class)->findAll();
  513. $categoriesRealisations = $em->getRepository(CategorieRealisation::class)->findAll();
  514. $chatAssistant = $em->getRepository(ChatAssistant::class)->findAll();
  515. $client = $em->getRepository(Client::class)->findAll();
  516. $compositionAccueil = $em->getRepository(CompositionAccueil::class)->findAll();
  517. $compteur = $em->getRepository(Compteur::class)->findAll();
  518. $cookies = $em->getRepository(Cookies::class)->findAll();
  519. $emplacements = $em->getRepository(Emplacement::class)->findAll();
  520. $horaires = $em->getRepository(HorairesDouverture::class)->findAll();
  521. $iconesColores = $em->getRepository(IconesColorees::class)->findAll();
  522. $images = $em->getRepository(Image::class)->findAll();
  523. $imageAccueil = $em->getRepository(ImagesAccueil::class)->findAll();
  524. $mentionsLegales = $em->getRepository(MentionsLegales::class)->findAll();
  525. $menus = $em->getRepository(Menu::class)->findAll();
  526. $menuActions = $em->getRepository(MenuActions::class)->findAll();
  527. $chiffresCles = $em->getRepository(NosChiffresCles::class)->findAll();
  528. $garanties = $em->getRepository(NosGaranties::class)->findAll();
  529. $tarifs = $em->getRepository(Tarif::class)->findAll();
  530. $quisommesnous = $em->getRepository(QuiSommesNous::class)->findAll();
  531. $pdc = $em->getRepository(PolitiqueDeConfidentialite::class)->findAll();
  532. $presentation = $em->getRepository(Presentation::class)->findAll();
  533. $realisations = $em->getRepository(Realisation::class)->findAll();
  534. $reseauxSociaux = $em->getRepository(ReseauxSociaux::class)->findAll();
  535. $sectionIconeColore = $em->getRepository(SectionIconeColoree::class)->findAll();
  536. $zoneDeintervention = $em->getRepository(SectionZoneDintervention::class)->findAll();
  537. $services = $em->getRepository(Service::class)->findAll();
  538. $temoignages = $em->getRepository(Temoignage::class)->findAll();
  539. $user = $em->getRepository(User::class)->findAll();
  540. $data = [
  541. 'globalParameters' => $websiteParameters[0],
  542. 'actualites' => $actualites,
  543. 'articles' => $articles,
  544. 'blogs' => $blogs,
  545. 'categoriesRealisations' => $categoriesRealisations,
  546. 'chatAssistant' => $chatAssistant,
  547. 'client' => $client,
  548. 'compositionAccueil' => $compositionAccueil,
  549. 'compteur' => $compteur,
  550. 'cookies' => $cookies,
  551. 'emplacements' => $emplacements,
  552. 'horaires' => $horaires,
  553. 'iconesColores' => $iconesColores,
  554. 'images' => $images,
  555. 'imageAccueil' => $imageAccueil,
  556. 'mentionsLegales' => $mentionsLegales,
  557. 'menus' => $menus,
  558. 'menuActions' => $menuActions,
  559. 'chiffresCles' => $chiffresCles,
  560. 'garanties' => $garanties,
  561. 'tarifs' => $tarifs,
  562. 'pdc' => $pdc,
  563. 'presentation' => $presentation,
  564. 'quisommesnous' => $quisommesnous,
  565. 'realisations' => $realisations,
  566. 'reseauxSociaux' => $reseauxSociaux,
  567. 'sectionIconeColore' => $sectionIconeColore,
  568. 'zoneDeintervention' => $zoneDeintervention,
  569. 'services' => $services,
  570. 'temoignages' => $temoignages,
  571. 'user' => $user
  572. ];
  573. return new Response($serializer->serialize($data,'json',['ignored_attributes' => ['contenu']]),200,['Content-Type' => 'application/json']);
  574. }
  575. }