mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
use correct repository for filters and aggregators
This commit is contained in:
parent
a789bf5e1c
commit
3a738179f2
@ -105,7 +105,7 @@ final readonly class ActivityTypeFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_activitytypes' => $this->denormalizeDoctrineEntity($formData['accepted_activitytypes'], $this->someRepository), 'date_after' => \Chill\MainBundle\Service\RollingDate\RollingDate::fromNormalized($formData['date_after']), 'date_before' => \Chill\MainBundle\Service\RollingDate\RollingDate::fromNormalized($formData['date_before'])];
|
||||
return ['accepted_activitytypes' => $this->denormalizeDoctrineEntity($formData['accepted_activitytypes'], $this->activityTypeRepository), 'date_after' => \Chill\MainBundle\Service\RollingDate\RollingDate::fromNormalized($formData['date_after']), 'date_before' => \Chill\MainBundle\Service\RollingDate\RollingDate::fromNormalized($formData['date_before'])];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -13,6 +13,7 @@ namespace Chill\ActivityBundle\Export\Filter;
|
||||
|
||||
use Chill\ActivityBundle\Entity\ActivityPresence;
|
||||
use Chill\ActivityBundle\Export\Declarations;
|
||||
use Chill\ActivityBundle\Repository\ActivityPresenceRepositoryInterface;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
@ -28,6 +29,7 @@ final readonly class ActivityPresenceFilter implements FilterInterface
|
||||
public function __construct(
|
||||
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||
private TranslatorInterface $translator,
|
||||
private ActivityPresenceRepositoryInterface $activityPresenceRepository,
|
||||
) {}
|
||||
|
||||
public function getTitle()
|
||||
@ -59,7 +61,7 @@ final readonly class ActivityPresenceFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['presences' => $this->denormalizeDoctrineEntity($formData['presences'], $this->someRepository)];
|
||||
return ['presences' => $this->denormalizeDoctrineEntity($formData['presences'], $this->activityPresenceRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -84,7 +84,7 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['types' => $this->denormalizeDoctrineEntity($formData['types'], $this->someRepository)];
|
||||
return ['types' => $this->denormalizeDoctrineEntity($formData['types'], $this->activityTypeRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -14,15 +14,16 @@ namespace Chill\ActivityBundle\Export\Filter;
|
||||
use Chill\ActivityBundle\Export\Declarations;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ActivityUsersFilter implements FilterInterface
|
||||
final readonly class ActivityUsersFilter 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
|
||||
{
|
||||
@ -66,7 +67,7 @@ class ActivityUsersFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->someRepository)];
|
||||
return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->userRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Export\Filter;
|
||||
use Chill\ActivityBundle\Export\Declarations;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
@ -22,7 +23,7 @@ class ByCreatorFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(private readonly UserRender $userRender) {}
|
||||
public function __construct(private readonly UserRender $userRender, private readonly UserRepositoryInterface $userRepository) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -62,7 +63,7 @@ class ByCreatorFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->someRepository)];
|
||||
return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->userRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -103,7 +103,7 @@ final readonly class CreatorJobFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->someRepository)];
|
||||
return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->userJobRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
@ -99,7 +99,7 @@ class CreatorScopeFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->someRepository)];
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->scopeRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
@ -14,13 +14,20 @@ namespace Chill\ActivityBundle\Export\Filter;
|
||||
use Chill\ActivityBundle\Export\Declarations;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickUserLocationType;
|
||||
use Chill\MainBundle\Repository\LocationRepository;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class LocationFilter implements FilterInterface
|
||||
final readonly class LocationFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(
|
||||
private LocationRepository $locationRepository,
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
return null;
|
||||
@ -60,7 +67,7 @@ class LocationFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_location' => $this->denormalizeDoctrineEntity($formData['accepted_location'], $this->someRepository)];
|
||||
return ['accepted_location' => $this->denormalizeDoctrineEntity($formData['accepted_location'], $this->locationRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -84,7 +84,7 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['reasons' => $this->denormalizeDoctrineEntity($formData['reasons'], $this->someRepository)];
|
||||
return ['reasons' => $this->denormalizeDoctrineEntity($formData['reasons'], $this->activityReasonRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -14,16 +14,17 @@ namespace Chill\ActivityBundle\Export\Filter;
|
||||
use Chill\ActivityBundle\Export\Declarations;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||
use Doctrine\ORM\Query\Expr\Andx;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class UserFilter implements FilterInterface
|
||||
final readonly class UserFilter 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
|
||||
{
|
||||
@ -71,7 +72,7 @@ class UserFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->someRepository)];
|
||||
return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->userRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -90,7 +90,7 @@ class UsersJobFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->someRepository)];
|
||||
return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->userJobRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string')
|
||||
|
@ -90,7 +90,7 @@ class UsersScopeFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->someRepository)];
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->scopeRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
@ -12,8 +12,9 @@ declare(strict_types=1);
|
||||
namespace Chill\ActivityBundle\Repository;
|
||||
|
||||
use Chill\ActivityBundle\Entity\ActivityPresence;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
|
||||
interface ActivityPresenceRepositoryInterface
|
||||
interface ActivityPresenceRepositoryInterface extends ObjectRepository
|
||||
{
|
||||
public function find($id): ?ActivityPresence;
|
||||
|
||||
|
@ -29,7 +29,7 @@ class ByActivityTypeFilter implements FilterInterface
|
||||
public function __construct(
|
||||
private readonly CategoryRender $categoryRender,
|
||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||
private readonly AsideActivityCategoryRepository $asideActivityTypeRepository,
|
||||
private readonly AsideActivityCategoryRepository $asideActivityTypeRepository, private readonly AsideActivityCategoryRepository $asideActivityCategoryRepository,
|
||||
) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
@ -82,7 +82,7 @@ class ByActivityTypeFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['types' => $this->denormalizeDoctrineEntity($formData['types'], $this->someRepository)];
|
||||
return ['types' => $this->denormalizeDoctrineEntity($formData['types'], $this->asideActivityCategoryRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\Location;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickUserLocationType;
|
||||
use Chill\MainBundle\Repository\LocationRepository;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
@ -27,6 +28,7 @@ final readonly class ByLocationFilter implements FilterInterface
|
||||
|
||||
public function __construct(
|
||||
private Security $security,
|
||||
private LocationRepository $locationRepository,
|
||||
) {}
|
||||
|
||||
public function getTitle(): string
|
||||
@ -52,7 +54,7 @@ final readonly class ByLocationFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['locations' => $this->denormalizeDoctrineEntity($formData['locations'], $this->someRepository)];
|
||||
return ['locations' => $this->denormalizeDoctrineEntity($formData['locations'], $this->locationRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -14,15 +14,16 @@ namespace Chill\AsideActivityBundle\Export\Filter;
|
||||
use Chill\AsideActivityBundle\Export\Declarations;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use Chill\MainBundle\Repository\UserRepository;
|
||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByUserFilter implements FilterInterface
|
||||
final readonly class ByUserFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(private readonly UserRender $userRender) {}
|
||||
public function __construct(private UserRender $userRender, private UserRepository $userRepository) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -63,7 +64,7 @@ class ByUserFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->someRepository)];
|
||||
return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->userRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -90,7 +90,7 @@ class ByUserJobFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->someRepository)];
|
||||
return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->userJobRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
@ -90,7 +90,7 @@ class ByUserScopeFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->someRepository)];
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->scopeRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string')
|
||||
|
@ -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
|
||||
|
@ -75,7 +75,7 @@ class EventTypeFilter implements ExportElementValidatedInterface, FilterInterfac
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['types' => $this->denormalizeDoctrineEntity($formData['types'], $this->someRepository)];
|
||||
return ['types' => $this->denormalizeDoctrineEntity($formData['types'], $this->eventTypeRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -75,7 +75,7 @@ class RoleFilter implements ExportElementValidatedInterface, FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['part_roles' => $this->denormalizeDoctrineEntity($formData['part_roles'], $this->someRepository)];
|
||||
return ['part_roles' => $this->denormalizeDoctrineEntity($formData['part_roles'], $this->roleRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -30,7 +30,11 @@ final readonly class GeographicalUnitStatAggregator implements AggregatorInterfa
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) {}
|
||||
public function __construct(
|
||||
private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository,
|
||||
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||
private RollingDateConverterInterface $rollingDateConverter,
|
||||
) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -137,7 +141,7 @@ final readonly class GeographicalUnitStatAggregator implements AggregatorInterfa
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['date_calc' => RollingDate::fromNormalized($formData['date_calc']), 'level' => $this->denormalizeDoctrineEntity($formData['level'], $this->someRepository)];
|
||||
return ['date_calc' => RollingDate::fromNormalized($formData['date_calc']), 'level' => $this->denormalizeDoctrineEntity($formData['level'], $this->geographicalUnitLayerRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -24,11 +24,15 @@ use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class GeographicalUnitAggregator implements AggregatorInterface
|
||||
final readonly class GeographicalUnitAggregator implements AggregatorInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) {}
|
||||
public function __construct(
|
||||
private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository,
|
||||
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||
private RollingDateConverterInterface $rollingDateConverter,
|
||||
) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -110,7 +114,7 @@ class GeographicalUnitAggregator implements AggregatorInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['date_calc' => RollingDate::fromNormalized($formData['date_calc']), 'level' => $this->denormalizeDoctrineEntity($formData['level'], $this->someRepository)];
|
||||
return ['date_calc' => RollingDate::fromNormalized($formData['date_calc']), 'level' => $this->denormalizeDoctrineEntity($formData['level'], $this->geographicalUnitLayerRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -13,16 +13,18 @@ namespace Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters;
|
||||
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickUserLocationType;
|
||||
use Chill\MainBundle\Repository\LocationRepository;
|
||||
use Chill\MainBundle\Repository\LocationTypeRepository;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class AdministrativeLocationFilter implements FilterInterface
|
||||
final readonly class AdministrativeLocationFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||
public function __construct(private TranslatableStringHelper $translatableStringHelper, private LocationTypeRepository $locationTypeRepository) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -62,7 +64,7 @@ class AdministrativeLocationFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_locations' => $this->denormalizeDoctrineEntity($formData['accepted_locations'], $this->someRepository)];
|
||||
return ['accepted_locations' => $this->denormalizeDoctrineEntity($formData['accepted_locations'], $this->locationTypeRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -15,16 +15,17 @@ use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\ClosingMotiveRepositoryInterface;
|
||||
use Doctrine\ORM\Query\Expr\Andx;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ClosingMotiveFilter implements FilterInterface
|
||||
final readonly class ClosingMotiveFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||
public function __construct(private TranslatableStringHelper $translatableStringHelper, private ClosingMotiveRepositoryInterface $closingMotiveRepository) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -73,7 +74,7 @@ class ClosingMotiveFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_closingmotives' => $this->denormalizeDoctrineEntity($formData['accepted_closingmotives'], $this->someRepository)];
|
||||
return ['accepted_closingmotives' => $this->denormalizeDoctrineEntity($formData['accepted_closingmotives'], $this->closingMotiveRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -14,15 +14,21 @@ namespace Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CreatorFilter implements FilterInterface
|
||||
final readonly class CreatorFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
function __construct(private readonly UserRepositoryInterface $userRepository)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
return null;
|
||||
@ -65,7 +71,7 @@ class CreatorFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_creators' => $this->denormalizeDoctrineEntity($formData['accepted_creators'], $this->someRepository)];
|
||||
return ['accepted_creators' => $this->denormalizeDoctrineEntity($formData['accepted_creators'], $this->userRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -22,14 +22,14 @@ use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CreatorJobFilter implements FilterInterface
|
||||
final readonly class CreatorJobFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acp_filter_creator_job';
|
||||
|
||||
public function __construct(
|
||||
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||
private TranslatableStringHelper $translatableStringHelper,
|
||||
private UserJobRepositoryInterface $userJobRepository,
|
||||
) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
@ -111,7 +111,7 @@ class CreatorJobFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['creator_job' => $this->denormalizeDoctrineEntity($formData['creator_job'], $this->someRepository)];
|
||||
return ['creator_job' => $this->denormalizeDoctrineEntity($formData['creator_job'], $this->userJobRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
@ -20,11 +20,11 @@ use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class EvaluationFilter implements FilterInterface
|
||||
final readonly class EvaluationFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(private readonly EvaluationRepositoryInterface $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||
public function __construct(private EvaluationRepositoryInterface $evaluationRepository, private TranslatableStringHelper $translatableStringHelper) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -79,7 +79,7 @@ class EvaluationFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_evaluations' => $this->denormalizeDoctrineEntity($formData['accepted_evaluations'], $this->someRepository)];
|
||||
return ['accepted_evaluations' => $this->denormalizeDoctrineEntity($formData['accepted_evaluations'], $this->evaluationRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -118,7 +118,7 @@ readonly class JobWorkingOnCourseFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->someRepository), 'start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])];
|
||||
return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->userJobRepository), 'start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
@ -15,16 +15,17 @@ use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\OriginRepository;
|
||||
use Doctrine\ORM\Query\Expr\Andx;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class OriginFilter implements FilterInterface
|
||||
final readonly class OriginFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||
public function __construct(private TranslatableStringHelper $translatableStringHelper, private OriginRepository $originRepository) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -73,7 +74,7 @@ class OriginFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_origins' => $this->denormalizeDoctrineEntity($formData['accepted_origins'], $this->someRepository)];
|
||||
return ['accepted_origins' => $this->denormalizeDoctrineEntity($formData['accepted_origins'], $this->originRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -14,13 +14,14 @@ namespace Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ReferrerFilter implements FilterInterface
|
||||
final readonly class ReferrerFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const A = 'acp_referrer_filter_uhistory';
|
||||
@ -29,7 +30,7 @@ class ReferrerFilter implements FilterInterface
|
||||
|
||||
private const PU = 'acp_referrer_filter_users';
|
||||
|
||||
public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {}
|
||||
public function __construct(private RollingDateConverterInterface $rollingDateConverter, private UserRepositoryInterface $userRepository) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -88,7 +89,7 @@ class ReferrerFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_referrers' => $this->denormalizeDoctrineEntity($formData['accepted_referrers'], $this->someRepository), 'date_calc' => RollingDate::fromNormalized($formData['date_calc'])];
|
||||
return ['accepted_referrers' => $this->denormalizeDoctrineEntity($formData['accepted_referrers'], $this->userRepository), 'date_calc' => RollingDate::fromNormalized($formData['date_calc'])];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use Chill\MainBundle\Repository\UserRepository;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||
@ -43,6 +44,7 @@ final readonly class ReferrerFilterBetweenDates implements FilterInterface
|
||||
public function __construct(
|
||||
private RollingDateConverterInterface $rollingDateConverter,
|
||||
private UserRender $userRender,
|
||||
private UserRepository $userRepository,
|
||||
) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
@ -103,7 +105,7 @@ final readonly class ReferrerFilterBetweenDates implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_referrers' => $this->denormalizeDoctrineEntity($formData['accepted_referrers'], $this->someRepository), 'start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])];
|
||||
return ['accepted_referrers' => $this->denormalizeDoctrineEntity($formData['accepted_referrers'], $this->userRepository), 'start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -113,7 +113,7 @@ readonly class ScopeWorkingOnCourseFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->someRepository), 'start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])];
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->scopeRepository), 'start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters;
|
||||
use Chill\MainBundle\Entity\User\UserJobHistory;
|
||||
use Chill\MainBundle\Entity\UserJob;
|
||||
use Chill\MainBundle\Export\DataTransformerInterface;
|
||||
use Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||
use Chill\MainBundle\Repository\UserJobRepositoryInterface;
|
||||
@ -30,6 +31,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class UserJobFilter implements FilterInterface, DataTransformerInterface
|
||||
{
|
||||
use ExportDataNormalizerTrait;
|
||||
|
||||
private const PREFIX = 'acp_filter_user_job';
|
||||
|
||||
public function __construct(
|
||||
@ -129,7 +132,7 @@ final readonly class UserJobFilter implements FilterInterface, DataTransformerIn
|
||||
public function normalizeFormData(array $formData): array
|
||||
{
|
||||
return [
|
||||
'jobs' => array_map(static fn (UserJob $job) => $job->getId(), (array) $formData['jobs']),
|
||||
'jobs' => $this->normalizeDoctrineEntity($formData['jobs']),
|
||||
'start_date' => $formData['start_date']->normalize(),
|
||||
'end_date' => $formData['end_date']->normalize(),
|
||||
];
|
||||
@ -138,7 +141,7 @@ final readonly class UserJobFilter implements FilterInterface, DataTransformerIn
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return [
|
||||
'jobs' => new ArrayCollection(array_filter(array_map(static fn (int $id) => $this->userJobRepository->find($id), $formData['jobs']), fn (?UserJob $job) => null !== $job)),
|
||||
'jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->userJobRepository),
|
||||
'start_date' => RollingDate::fromNormalized($formData['start_date']),
|
||||
'end_date' => RollingDate::fromNormalized($formData['end_date']),
|
||||
];
|
||||
|
@ -109,7 +109,7 @@ final readonly class UserScopeFilter implements FilterInterface, DataTransformer
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->someRepository), 'start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])];
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->scopeRepository), 'start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string')
|
||||
|
@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||
@ -36,6 +37,7 @@ final readonly class UserWorkingOnCourseFilter implements FilterInterface
|
||||
public function __construct(
|
||||
private UserRender $userRender,
|
||||
private RollingDateConverterInterface $rollingDateConverter,
|
||||
private UserRepositoryInterface $userRepository,
|
||||
) {}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
@ -65,7 +67,7 @@ final readonly class UserWorkingOnCourseFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['users' => $this->denormalizeDoctrineEntity($formData['users'], $this->someRepository), 'start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])];
|
||||
return ['users' => $this->denormalizeDoctrineEntity($formData['users'], $this->userRepository), 'start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -72,7 +72,7 @@ final readonly class EvaluationTypeFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_evaluationtype' => $this->denormalizeDoctrineEntity($formData['accepted_evaluationtype'], $this->someRepository)];
|
||||
return ['accepted_evaluationtype' => $this->denormalizeDoctrineEntity($formData['accepted_evaluationtype'], $this->evaluationRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -18,6 +18,7 @@ use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\Household\HouseholdCompositionType;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Chill\PersonBundle\Repository\Household\HouseholdCompositionTypeRepositoryInterface;
|
||||
use Doctrine\ORM\Query\Expr;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
@ -30,6 +31,7 @@ readonly class CompositionFilter implements FilterInterface
|
||||
public function __construct(
|
||||
private TranslatableStringHelper $translatableStringHelper,
|
||||
private RollingDateConverterInterface $rollingDateConverter,
|
||||
private HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository,
|
||||
) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
@ -92,7 +94,7 @@ readonly class CompositionFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_composition' => $this->denormalizeDoctrineEntity($formData['accepted_composition'], $this->someRepository), 'on_date' => RollingDate::fromNormalized($formData['on_date'])];
|
||||
return ['accepted_composition' => $this->denormalizeDoctrineEntity($formData['accepted_composition'], $this->householdCompositionTypeRepository), 'on_date' => RollingDate::fromNormalized($formData['on_date'])];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -90,7 +90,7 @@ class ByHouseholdCompositionFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['compositions' => $this->denormalizeDoctrineEntity($formData['compositions'], $this->someRepository), 'calc_date' => RollingDate::fromNormalized($formData['calc_date'])];
|
||||
return ['compositions' => $this->denormalizeDoctrineEntity($formData['compositions'], $this->householdCompositionTypeRepository), 'calc_date' => RollingDate::fromNormalized($formData['calc_date'])];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -15,13 +15,14 @@ use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\MaritalStatus;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Chill\PersonBundle\Repository\MaritalStatusRepositoryInterface;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
|
||||
class MaritalStatusFilter implements FilterInterface
|
||||
final readonly class MaritalStatusFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||
public function __construct(private TranslatableStringHelper $translatableStringHelper, private MaritalStatusRepositoryInterface $maritalStatusRepository) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -65,7 +66,7 @@ class MaritalStatusFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['maritalStatus' => $this->denormalizeDoctrineEntity($formData['maritalStatus'], $this->someRepository)];
|
||||
return ['maritalStatus' => $this->denormalizeDoctrineEntity($formData['maritalStatus'], $this->maritalStatusRepository)];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -19,16 +19,21 @@ use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\Person\ResidentialAddress;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyCategory;
|
||||
use Chill\ThirdPartyBundle\Repository\ThirdPartyCategoryRepository;
|
||||
use Doctrine\ORM\Query\Expr;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ResidentialAddressAtThirdpartyFilter implements FilterInterface
|
||||
final readonly class ResidentialAddressAtThirdpartyFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||
public function __construct(
|
||||
private RollingDateConverterInterface $rollingDateConverter,
|
||||
private TranslatableStringHelper $translatableStringHelper,
|
||||
private ThirdPartyCategoryRepository $thirdPartyCategoryRepository,
|
||||
) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -113,7 +118,7 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['thirdparty_cat' => $this->denormalizeDoctrineEntity($formData['thirdparty_cat'], $this->someRepository), 'date_calc' => RollingDate::fromNormalized($formData['date_calc'])];
|
||||
return ['thirdparty_cat' => $this->denormalizeDoctrineEntity($formData['thirdparty_cat'], $this->thirdPartyCategoryRepository), 'date_calc' => RollingDate::fromNormalized($formData['date_calc'])];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -14,16 +14,22 @@ namespace Chill\PersonBundle\Export\Filter\SocialWorkFilters;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CreatorFilter implements FilterInterface
|
||||
final readonly class CreatorFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acpw_filter_creator';
|
||||
|
||||
function __construct(private UserRepositoryInterface $userRepository)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
return null;
|
||||
@ -65,7 +71,7 @@ class CreatorFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['creators' => $this->denormalizeDoctrineEntity($formData['creators'], $this->someRepository)];
|
||||
return ['creators' => $this->denormalizeDoctrineEntity($formData['creators'], $this->userRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
@ -22,14 +22,14 @@ use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CreatorJobFilter implements FilterInterface
|
||||
final readonly class CreatorJobFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acpw_filter_creator_job';
|
||||
|
||||
public function __construct(
|
||||
private readonly UserJobRepository $userJobRepository,
|
||||
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||
private UserJobRepository $userJobRepository,
|
||||
private TranslatableStringHelper $translatableStringHelper,
|
||||
) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
@ -91,7 +91,7 @@ class CreatorJobFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->someRepository)];
|
||||
return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->userJobRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
@ -91,7 +91,7 @@ class CreatorScopeFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->someRepository)];
|
||||
return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->scopeRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
|
@ -15,23 +15,21 @@ use Chill\MainBundle\Entity\UserJob;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Repository\UserJobRepositoryInterface;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkReferrerHistory;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class JobFilter implements FilterInterface
|
||||
final readonly class JobFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acp_work_action_filter_user_job';
|
||||
|
||||
public function __construct(
|
||||
protected TranslatorInterface $translator,
|
||||
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||
private UserJobRepositoryInterface $userJobRepository,
|
||||
) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
@ -85,7 +83,7 @@ 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')
|
||||
|
@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Export\Filter\SocialWorkFilters;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
@ -25,7 +26,7 @@ final readonly class ReferrerFilter implements FilterInterface
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acpw_referrer_filter';
|
||||
|
||||
public function __construct(private RollingDateConverterInterface $rollingDateConverter) {}
|
||||
public function __construct(private RollingDateConverterInterface $rollingDateConverter, private UserRepositoryInterface $userRepository) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -80,7 +81,7 @@ final readonly class ReferrerFilter implements FilterInterface
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['accepted_agents' => $this->denormalizeDoctrineEntity($formData['accepted_agents'], $this->someRepository), 'agent_at' => RollingDate::fromNormalized($formData['agent_at'])];
|
||||
return ['accepted_agents' => $this->denormalizeDoctrineEntity($formData['accepted_agents'], $this->userRepository), 'agent_at' => RollingDate::fromNormalized($formData['agent_at'])];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
|
@ -23,15 +23,14 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ScopeFilter implements FilterInterface
|
||||
final readonly class ScopeFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acp_work_action_filter_user_scope';
|
||||
|
||||
public function __construct(
|
||||
protected TranslatorInterface $translator,
|
||||
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||
private TranslatableStringHelper $translatableStringHelper,
|
||||
private ScopeRepositoryInterface $scopeRepository,
|
||||
) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
@ -84,7 +83,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
|
||||
|
@ -12,15 +12,16 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Repository\AccompanyingPeriod;
|
||||
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
final readonly class OriginRepository
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Origin>
|
||||
*/
|
||||
final class OriginRepository extends ServiceEntityRepository
|
||||
{
|
||||
private EntityRepository $repository;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager)
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
$this->repository = $entityManager->getRepository(Origin::class);
|
||||
parent::__construct($registry, Origin::class);
|
||||
}
|
||||
}
|
||||
|
@ -12,8 +12,9 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Repository;
|
||||
|
||||
use Chill\PersonBundle\Entity\MaritalStatus;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
|
||||
interface MaritalStatusRepositoryInterface
|
||||
interface MaritalStatusRepositoryInterface extends ObjectRepository
|
||||
{
|
||||
public function find($id): ?MaritalStatus;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user