Browse Source

OpeningStore : section optionnal

packProduct
Guillaume 2 years ago
parent
commit
b7486797e1
2 changed files with 1 additions and 32 deletions
  1. +0
    -30
      EventSubscriber/OpeningEventSubscriber.php
  2. +1
    -2
      Repository/Section/OpeningStore.php

+ 0
- 30
EventSubscriber/OpeningEventSubscriber.php View File

<?php

namespace Lc\CaracoleBundle\EventSubscriber;

use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;

class OpeningEventSubscriber implements EventSubscriberInterface
{
protected EntityManagerInterface $entityManager;

public function __construct(
EntityManagerInterface $entityManager
) {
$this->entityManager = $entityManager;
}

public static function getSubscribedEvents()
{
return [
KernelEvents::CONTROLLER => ['initOpenings']
];
}

public function initOpenings()
{
}

}

+ 1
- 2
Repository/Section/OpeningStore.php View File



public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{ {
$query->filterBySection($this->section);
$this->addFilterBySectionOptionnal($query);
return $query; return $query;
} }


{ {
return $query; return $query;
} }

} }

Loading…
Cancel
Save