<?php declare(strict_types=1);
namespace App\Controller;
use App\Doctrine\Cache\CacheDecider;
use App\Repository\PerformerRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
class HomepageController extends AbstractController
{
private PerformerRepository $performerRepository;
private CacheDecider $cacheDecider;
public function __construct(PerformerRepository $performerRepository, CacheDecider $cacheDecider)
{
$this->performerRepository = $performerRepository;
$this->cacheDecider = $cacheDecider;
}
public function home(): Response
{
$performer = $this->performerRepository->filterResults([], $this->cacheDecider);
return $this->render('homepage.html.twig', [
'performer' => $performer,
]);
}
}