<?php
namespace App\Controller\Front;
use App\Entity\{Partner, Article, ContactPage};
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 FooterController extends AbstractController
{
public function partners(EntityManagerInterface $entityManager): Response
{
$partners = $entityManager->getRepository(Partner::class)->findBy([], ['id' => 'ASC']);
return $this->render('front/footer/partner.html.twig', [
'partners' => $partners
]);
}
public function articles(EntityManagerInterface $entityManager): Response
{
$lastArticles = $entityManager->getRepository(Article::class)->findBy(['status' => true], ['id' => 'DESC'], 3, 0);
return $this->render('front/footer/last_article.html.twig', [
'lastArticles' => $lastArticles
]);
}
public function contact(EntityManagerInterface $entityManager): Response
{
$contact = $entityManager->getRepository(ContactPage::class)->findOneBy([], ['id' => 'DESC']);
return $this->render('front/footer/social_network.html.twig', [
'contact' => $contact
]);
}
}