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