mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix configuration for EventSearch
This commit is contained in:
parent
aa553db659
commit
d048ee3b44
@ -43,10 +43,10 @@ class EventSearch extends AbstractSearch
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly Security $security,
|
private readonly Security $security,
|
||||||
private readonly EventRepository $er,
|
private readonly EventRepository $eventRepository,
|
||||||
private readonly AuthorizationHelper $authorizationHelper,
|
private readonly AuthorizationHelper $authorizationHelper,
|
||||||
private readonly \Twig\Environment $templating,
|
private readonly \Twig\Environment $templating,
|
||||||
private readonly PaginatorFactory $paginationFactory
|
private readonly PaginatorFactory $paginatorFactory
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ class EventSearch extends AbstractSearch
|
|||||||
$format = 'html'
|
$format = 'html'
|
||||||
) {
|
) {
|
||||||
$total = $this->count($terms);
|
$total = $this->count($terms);
|
||||||
$paginator = $this->paginationFactory->create($total);
|
$paginator = $this->paginatorFactory->create($total);
|
||||||
|
|
||||||
if ('html' === $format) {
|
if ('html' === $format) {
|
||||||
return $this->templating->render(
|
return $this->templating->render(
|
||||||
@ -184,7 +184,7 @@ class EventSearch extends AbstractSearch
|
|||||||
|
|
||||||
protected function count(array $terms)
|
protected function count(array $terms)
|
||||||
{
|
{
|
||||||
$qb = $this->er->createQueryBuilder('e');
|
$qb = $this->eventRepository->createQueryBuilder('e');
|
||||||
$qb->select('COUNT(e)');
|
$qb->select('COUNT(e)');
|
||||||
$this->composeQuery($qb, $terms);
|
$this->composeQuery($qb, $terms);
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ class EventSearch extends AbstractSearch
|
|||||||
|
|
||||||
protected function search(array $terms, $start, $limit, $options)
|
protected function search(array $terms, $start, $limit, $options)
|
||||||
{
|
{
|
||||||
$qb = $this->er->createQueryBuilder('e');
|
$qb = $this->eventRepository->createQueryBuilder('e');
|
||||||
$qb->select('e');
|
$qb->select('e');
|
||||||
$this->composeQuery($qb, $terms)
|
$this->composeQuery($qb, $terms)
|
||||||
->setMaxResults($limit)
|
->setMaxResults($limit)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user