|
|
@@ -10,6 +10,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto; |
|
|
|
use Lc\SovBundle\Repository\RepositoryQueryInterface; |
|
|
|
use Lc\SovBundle\Translation\TranslatorAdmin; |
|
|
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType; |
|
|
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; |
|
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
|
|
@@ -31,13 +32,15 @@ class FilterManager |
|
|
|
{ |
|
|
|
protected $em; |
|
|
|
protected bool $isFiltered = false; |
|
|
|
protected $translatorAdmin; |
|
|
|
|
|
|
|
use FilterTrait; |
|
|
|
|
|
|
|
public function __construct(SessionInterface $session, EntityManagerInterface $entityManager) |
|
|
|
public function __construct(SessionInterface $session, EntityManagerInterface $entityManager, TranslatorAdmin $translatorAdmin) |
|
|
|
{ |
|
|
|
$this->session = $session; |
|
|
|
$this->em = $entityManager; |
|
|
|
$this->translatorAdmin = $translatorAdmin; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@@ -93,7 +96,7 @@ class FilterManager |
|
|
|
{ |
|
|
|
if ($fieldDto->getCustomOption('filter_fqcn')) { |
|
|
|
$filterFqcn = $fieldDto->getCustomOption('filter_fqcn'); |
|
|
|
$customFilter = new $filterFqcn; |
|
|
|
$customFilter = new $filterFqcn($this->translatorAdmin); |
|
|
|
|
|
|
|
$customFilter->applyFilter($repositoryQuery, $fieldDto, $filteredValue['value']); |
|
|
|
} else { |