mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-25 16:14:59 +00:00
use correct repository for filters and aggregators
This commit is contained in:
@@ -14,17 +14,18 @@ namespace Chill\CalendarBundle\Export\Filter;
|
||||
use Chill\CalendarBundle\Export\Declarations;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||
use Doctrine\ORM\Query\Expr\Andx;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class AgentFilter implements FilterInterface
|
||||
final readonly class AgentFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(private readonly UserRender $userRender) {}
|
||||
public function __construct(private UserRender $userRender, private UserRepositoryInterface $userRepository) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@@ -73,7 +74,7 @@ class AgentFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_agents' => $this->denormalizeDoctrineEntity($formData['accepted_agents'], $this->someRepository)];
|
||||
return ['accepted_agents' => $this->denormalizeDoctrineEntity($formData['accepted_agents'], $this->userRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@@ -97,7 +97,7 @@ final readonly class JobFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['job' => $this->denormalizeDoctrineEntity($formData['job'], $this->someRepository)];
|
||||
return ['job' => $this->denormalizeDoctrineEntity($formData['job'], $this->userJobRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
@@ -99,7 +99,7 @@ class ScopeFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['scope' => $this->denormalizeDoctrineEntity($formData['scope'], $this->someRepository)];
|
||||
return ['scope' => $this->denormalizeDoctrineEntity($formData['scope'], $this->scopeRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
Reference in New Issue
Block a user