diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php index edfa9b030..f2216c929 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php @@ -13,10 +13,10 @@ namespace Chill\ActivityBundle\Export\Filter; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Export\FilterInterface; +use Chill\MainBundle\Form\Type\Export\FilterType; use Chill\MainBundle\Form\Type\PickRollingDateType; use Chill\MainBundle\Service\RollingDate\RollingDate; use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; -use Chill\MainBundle\Form\Type\Export\FilterType; use Doctrine\ORM\Query\Expr; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; @@ -27,10 +27,10 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ActivityDateFilter implements FilterInterface { - private RollingDateConverterInterface $rollingDateConverter; - protected TranslatorInterface $translator; + private RollingDateConverterInterface $rollingDateConverter; + public function __construct( TranslatorInterface $translator, RollingDateConverterInterface $rollingDateConverter @@ -60,10 +60,12 @@ class ActivityDateFilter implements FilterInterface } $qb->add('where', $where); - $qb->setParameter('date_from', + $qb->setParameter( + 'date_from', $this->rollingDateConverter->convert($data['date_from']) ); - $qb->setParameter('date_to', + $qb->setParameter( + 'date_to', $this->rollingDateConverter->convert($data['date_to']) ); } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php index fca4dece8..099c87fc0 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php @@ -13,10 +13,10 @@ namespace Chill\AsideActivityBundle\Export\Filter; use Chill\AsideActivityBundle\Export\Declarations; use Chill\MainBundle\Export\FilterInterface; +use Chill\MainBundle\Form\Type\Export\FilterType; use Chill\MainBundle\Form\Type\PickRollingDateType; use Chill\MainBundle\Service\RollingDate\RollingDate; use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; -use Chill\MainBundle\Form\Type\Export\FilterType; use Doctrine\ORM\Query\Expr\Andx; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; @@ -27,10 +27,10 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ByDateFilter implements FilterInterface { - private RollingDateConverterInterface $rollingDateConverter; - protected TranslatorInterface $translator; + private RollingDateConverterInterface $rollingDateConverter; + public function __construct( RollingDateConverterInterface $rollingDateConverter, TranslatorInterface $translator @@ -60,10 +60,12 @@ class ByDateFilter implements FilterInterface } $qb->add('where', $where); - $qb->setParameter('date_from', + $qb->setParameter( + 'date_from', $this->rollingDateConverter->convert($data['date_from']) ); - $qb->setParameter('date_to', + $qb->setParameter( + 'date_to', $this->rollingDateConverter->convert($data['date_to']) ); } diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php index 01bfad033..9e0358609 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php @@ -50,11 +50,13 @@ class BetweenDatesFilter implements FilterInterface } $qb->add('where', $where); - $qb->setParameter('dateFrom', + $qb->setParameter( + 'dateFrom', $this->rollingDateConverter->convert($data['date_from']) ); // modify dateTo so that entire day is also taken into account up until the beginning of the next day. - $qb->setParameter('dateTo', + $qb->setParameter( + 'dateTo', $this->rollingDateConverter->convert($data['date_to'])->modify('+1 day') ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php index 59a39ab12..22a2cb719 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php @@ -16,9 +16,9 @@ use Chill\MainBundle\Entity\GeographicalUnit; use Chill\MainBundle\Entity\GeographicalUnitLayer; use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Form\Type\PickRollingDateType; +use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface; use Chill\MainBundle\Service\RollingDate\RollingDate; use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; -use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Chill\PersonBundle\Entity\Household\PersonHouseholdAddress; use Chill\PersonBundle\Export\Declarations; @@ -33,10 +33,10 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface { private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository; - private TranslatableStringHelperInterface $translatableStringHelper; - private RollingDateConverterInterface $rollingDateConverter; + private TranslatableStringHelperInterface $translatableStringHelper; + public function __construct( GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, TranslatableStringHelperInterface $translatableStringHelper, @@ -67,7 +67,8 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface ) ); - $qb->setParameter('acp_geog_aggregator_date', + $qb->setParameter( + 'acp_geog_aggregator_date', $this->rollingDateConverter->convert($data['date_calc']) ); } @@ -88,7 +89,8 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface ) ); - $qb->setParameter('acp_geog_aggregator_date', + $qb->setParameter( + 'acp_geog_aggregator_date', $this->rollingDateConverter->convert($data['date_calc']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php index 84da976c6..01bc3a459 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php @@ -13,9 +13,9 @@ namespace Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators; use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Form\Type\PickRollingDateType; +use Chill\MainBundle\Repository\UserRepository; use Chill\MainBundle\Service\RollingDate\RollingDate; use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; -use Chill\MainBundle\Repository\UserRepository; use Chill\MainBundle\Templating\Entity\UserRender; use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; @@ -27,12 +27,12 @@ final class ReferrerAggregator implements AggregatorInterface private const P = 'acp_ref_agg_date'; + private RollingDateConverterInterface $rollingDateConverter; + private UserRender $userRender; private UserRepository $userRepository; - private RollingDateConverterInterface $rollingDateConverter; - public function __construct( UserRepository $userRepository, UserRender $userRender, @@ -66,7 +66,8 @@ final class ReferrerAggregator implements AggregatorInterface ) ) ) - ->setParameter(self::P, + ->setParameter( + self::P, $this->rollingDateConverter->convert($data['date_calc']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php index 16ff76e3d..62f8cdef2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php @@ -13,9 +13,9 @@ namespace Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators; use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Form\Type\PickRollingDateType; +use Chill\MainBundle\Repository\ScopeRepositoryInterface; use Chill\MainBundle\Service\RollingDate\RollingDate; use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; -use Chill\MainBundle\Repository\ScopeRepositoryInterface; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; @@ -26,12 +26,12 @@ class ReferrerScopeAggregator implements AggregatorInterface { private const SCOPE_KEY = 'acp_agg_refscope_user_history_ref_scope_name'; + private RollingDateConverterInterface $rollingDateConverter; + private ScopeRepositoryInterface $scopeRepository; private TranslatableStringHelperInterface $translatableStringHelper; - private RollingDateConverterInterface $rollingDateConverter; - public function __construct( ScopeRepositoryInterface $scopeRepository, TranslatableStringHelperInterface $translatableStringHelper, @@ -69,7 +69,8 @@ class ReferrerScopeAggregator implements AggregatorInterface ) ) ) - ->setParameter($dateCalc, + ->setParameter( + $dateCalc, $this->rollingDateConverter->convert($data['date_calc']) ); diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php index aa2e9b4b6..0c9bc623f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php @@ -24,10 +24,10 @@ use function in_array; class ChildrenNumberAggregator implements AggregatorInterface { - private TranslatorInterface $translator; - private RollingDateConverterInterface $rollingDateConverter; + private TranslatorInterface $translator; + public function __construct( TranslatorInterface $translator, RollingDateConverterInterface $rollingDateConverter @@ -59,7 +59,8 @@ class ChildrenNumberAggregator implements AggregatorInterface ->addSelect('composition_children.numberOfChildren AS childrennumber_aggregator') ->addGroupBy('childrennumber_aggregator'); - $qb->setParameter('ondate_composition_children', + $qb->setParameter( + 'ondate_composition_children', $this->rollingDateConverter->convert($data['on_date']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php index 1917a51b3..19884dd10 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php @@ -25,12 +25,12 @@ use function in_array; class CompositionAggregator implements AggregatorInterface { + private RollingDateConverterInterface $rollingDateConverter; + private TranslatableStringHelper $translatableStringHelper; private HouseholdCompositionTypeRepository $typeRepository; - private RollingDateConverterInterface $rollingDateConverter; - public function __construct( HouseholdCompositionTypeRepository $typeRepository, TranslatableStringHelper $translatableStringHelper, @@ -64,7 +64,8 @@ class CompositionAggregator implements AggregatorInterface ->addSelect('IDENTITY(composition_type.householdCompositionType) AS composition_aggregator') ->addGroupBy('composition_aggregator'); - $qb->setParameter('ondate_composition_type', + $qb->setParameter( + 'ondate_composition_type', $this->rollingDateConverter->convert($data['on_date']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php index 576f52626..03e5f17ce 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php @@ -29,10 +29,10 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface private HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository; - private TranslatableStringHelperInterface $translatableStringHelper; - private RollingDateConverterInterface $rollingDateConverter; + private TranslatableStringHelperInterface $translatableStringHelper; + public function __construct( RollingDateConverterInterface $rollingDateConverter, HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, @@ -78,7 +78,8 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface ) ) ->addSelect("IDENTITY({$p}_compo.householdCompositionType) AS {$p}_select") - ->setParameter("{$p}_date", + ->setParameter( + "{$p}_date", $this->rollingDateConverter->convert($data['date_calc']) ) ->addGroupBy("{$p}_select"); diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php index dd6f10035..6c92be3fd 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php @@ -15,9 +15,9 @@ use Chill\MainBundle\Entity\GeographicalUnit; use Chill\MainBundle\Entity\GeographicalUnitLayer; use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Form\Type\PickRollingDateType; +use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface; use Chill\MainBundle\Service\RollingDate\RollingDate; use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; -use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\Query\Expr\Join; @@ -30,10 +30,10 @@ class GeographicalUnitAggregator implements AggregatorInterface { private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository; - private TranslatableStringHelperInterface $translatableStringHelper; - private RollingDateConverterInterface $rollingDateConverter; + private TranslatableStringHelperInterface $translatableStringHelper; + public function __construct( GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, TranslatableStringHelperInterface $translatableStringHelper, @@ -73,7 +73,8 @@ class GeographicalUnitAggregator implements AggregatorInterface $qb->expr()->in('person_geog_agg_geog_unit.layer', ':person_geog_agg_layers') ) ) - ->setParameter('person_geog_agg_date', + ->setParameter( + 'person_geog_agg_date', $this->rollingDateConverter->convert($data['date_calc']) ) ->setParameter('person_geog_agg_layers', $data['level']) diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php index 0d986bdea..ea516dbb0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php @@ -31,12 +31,12 @@ final class HouseholdPositionAggregator implements AggregatorInterface, ExportEl { private PositionRepository $positionRepository; + private RollingDateConverterInterface $rollingDateConverter; + private TranslatableStringHelper $translatableStringHelper; private TranslatorInterface $translator; - private RollingDateConverterInterface $rollingDateConverter; - public function __construct( TranslatorInterface $translator, TranslatableStringHelper $translatableStringHelper, @@ -72,7 +72,8 @@ final class HouseholdPositionAggregator implements AggregatorInterface, ExportEl ) )); - $qb->setParameter('date', + $qb->setParameter( + 'date', $this->rollingDateConverter->convert($data['date_position']) ); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php index 55fe56d59..3fa8d711f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php @@ -53,7 +53,8 @@ class ActiveOnDateFilter implements FilterInterface } $qb->add('where', $where); - $qb->setParameter('ondate', + $qb->setParameter( + 'ondate', $this->rollingDateConverter->convert($data['on_date']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php index 4d1a9ad23..f713e8a97 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php @@ -38,10 +38,12 @@ class ActiveOneDayBetweenDatesFilter implements FilterInterface $clause = "OVERLAPSI (acp.openingDate, acp.closingDate), (:datefrom, :dateto) = 'TRUE'"; $qb->andWhere($clause); - $qb->setParameter('datefrom', + $qb->setParameter( + 'datefrom', $this->rollingDateConverter->convert($data['date_from']) ); - $qb->setParameter('dateto', + $qb->setParameter( + 'dateto', $this->rollingDateConverter->convert($data['date_to']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php index 55e710f8e..0c445ec3b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php @@ -16,10 +16,10 @@ use Chill\MainBundle\Entity\GeographicalUnit; use Chill\MainBundle\Entity\GeographicalUnit\SimpleGeographicalUnitDTO; use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Form\Type\PickRollingDateType; -use Chill\MainBundle\Service\RollingDate\RollingDate; -use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface; use Chill\MainBundle\Repository\GeographicalUnitRepositoryInterface; +use Chill\MainBundle\Service\RollingDate\RollingDate; +use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\Household\PersonHouseholdAddress; @@ -40,10 +40,10 @@ class GeographicalUnitStatFilter implements FilterInterface private GeographicalUnitRepositoryInterface $geographicalUnitRepository; - private TranslatableStringHelperInterface $translatableStringHelper; - private RollingDateConverterInterface $rollingDateConverter; + private TranslatableStringHelperInterface $translatableStringHelper; + public function __construct( EntityManagerInterface $em, GeographicalUnitRepositoryInterface $geographicalUnitRepository, @@ -88,7 +88,8 @@ class GeographicalUnitStatFilter implements FilterInterface $qb ->andWhere($qb->expr()->exists($subQueryDql)) - ->setParameter('acp_geog_filter_date', + ->setParameter( + 'acp_geog_filter_date', $this->rollingDateConverter->convert($data['date_calc']) ) ->setParameter('acp_geog_filter_units', array_map(static fn (SimpleGeographicalUnitDTO $unitDTO) => $unitDTO->id, $data['units'])); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php index ff30b6312..4c682a56a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php @@ -49,7 +49,8 @@ class HasNoReferrerFilter implements FilterInterface AND uh.accompanyingPeriod = acp ) ') - ->setParameter('has_no_referrer_filter_date', + ->setParameter( + 'has_no_referrer_filter_date', $this->rollingDateConverter->convert($data['calc_date']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php index 3dfbea9c2..7aadde734 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php @@ -42,7 +42,8 @@ class HasTemporaryLocationFilter implements FilterInterface ->join('acp.locationHistories', 'acp_having_temporarily_location') ->andWhere('acp_having_temporarily_location.startDate <= :acp_having_temporarily_location_date AND (acp_having_temporarily_location.endDate IS NULL OR acp_having_temporarily_location.endDate > :acp_having_temporarily_location_date)') - ->setParameter('acp_having_temporarily_location_date', + ->setParameter( + 'acp_having_temporarily_location_date', $this->rollingDateConverter->convert($data['calc_date']) ); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php index 5e1ad18b9..b37d90d84 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php @@ -13,9 +13,9 @@ 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\Service\RollingDate\RollingDate; use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; -use Chill\MainBundle\Form\Type\PickUserDynamicType; use Chill\MainBundle\Templating\Entity\UserRender; use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; @@ -29,10 +29,10 @@ class ReferrerFilter implements FilterInterface private const PU = 'acp_referrer_filter_users'; - private UserRender $userRender; - private RollingDateConverterInterface $rollingDateConverter; + private UserRender $userRender; + public function __construct( UserRender $userRender, RollingDateConverterInterface $rollingDateConverter @@ -63,7 +63,8 @@ class ReferrerFilter implements FilterInterface $qb->expr()->in(self::A . '.user', ':' . self::PU) ) ->setParameter(self::PU, $data['accepted_referrers']) - ->setParameter(self::P, + ->setParameter( + self::P, $this->rollingDateConverter->convert($data['date_calc']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php index fadc5d295..b97f97dda 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php @@ -15,9 +15,9 @@ use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\UserJob; use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Form\Type\PickRollingDateType; +use Chill\MainBundle\Repository\UserJobRepositoryInterface; use Chill\MainBundle\Service\RollingDate\RollingDate; use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; -use Chill\MainBundle\Repository\UserJobRepositoryInterface; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; @@ -35,14 +35,14 @@ class UserJobFilter implements FilterInterface private const PJ = 'acp_ujob_filter_job'; + private RollingDateConverterInterface $rollingDateConverter; + private Security $security; private TranslatableStringHelper $translatableStringHelper; private UserJobRepositoryInterface $userJobRepository; - private RollingDateConverterInterface $rollingDateConverter; - public function __construct( Security $security, TranslatableStringHelper $translatableStringHelper, @@ -73,7 +73,8 @@ class UserJobFilter implements FilterInterface ) ) ) - ->setParameter(self::P, + ->setParameter( + self::P, $this->rollingDateConverter->convert($data['date_calc']) ) ->join(self::A . '.user', self::AU) diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php index 3fcf4f87e..bbffa4bca 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php @@ -15,9 +15,9 @@ use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Form\Type\PickRollingDateType; +use Chill\MainBundle\Repository\ScopeRepositoryInterface; use Chill\MainBundle\Service\RollingDate\RollingDate; use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; -use Chill\MainBundle\Repository\ScopeRepositoryInterface; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; @@ -35,14 +35,14 @@ class UserScopeFilter implements FilterInterface private const PS = 'acp_uscope_filter_scopes'; + private RollingDateConverterInterface $rollingDateConverter; + private ScopeRepositoryInterface $scopeRepository; private Security $security; private TranslatableStringHelper $translatableStringHelper; - private RollingDateConverterInterface $rollingDateConverter; - public function __construct( ScopeRepositoryInterface $scopeRepository, Security $security, @@ -73,7 +73,8 @@ class UserScopeFilter implements FilterInterface ) ) ) - ->setParameter(self::P, + ->setParameter( + self::P, $this->rollingDateConverter->convert($data['date_calc']) ) ->join(self::A . '.user', self::AU) diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php index 5021da1bc..1f14b04ac 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php @@ -38,10 +38,12 @@ class ByEndDateFilter implements FilterInterface { $qb ->andWhere('workeval.endDate BETWEEN :work_eval_by_end_date_start_date and :work_eval_by_end_date_end_date') - ->setParameter('work_eval_by_end_date_start_date', + ->setParameter( + 'work_eval_by_end_date_start_date', $this->rollingDateConverter->convert($data['start_date']) ) - ->setParameter('work_eval_by_end_date_end_date', + ->setParameter( + 'work_eval_by_end_date_end_date', $this->rollingDateConverter->convert($data['end_date']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php index c5c4c8899..000f3447e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php @@ -38,10 +38,12 @@ class ByStartDateFilter implements FilterInterface { $qb ->andWhere('workeval.startDate BETWEEN :work_eval_by_start_date_start_date and :work_eval_by_start_date_end_date') - ->setParameter('work_eval_by_start_date_start_date', + ->setParameter( + 'work_eval_by_start_date_start_date', $this->rollingDateConverter->convert($data['start_date']) ) - ->setParameter('work_eval_by_start_date_end_date', + ->setParameter( + 'work_eval_by_start_date_end_date', $this->rollingDateConverter->convert($data['end_date']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php index e9b06d6af..922702418 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php @@ -26,10 +26,10 @@ use function in_array; class CompositionFilter implements FilterInterface { - private TranslatableStringHelper $translatableStringHelper; - private RollingDateConverterInterface $rollingDateConverter; + private TranslatableStringHelper $translatableStringHelper; + public function __construct( TranslatableStringHelper $translatableStringHelper, RollingDateConverterInterface $rollingDateConverter @@ -62,7 +62,8 @@ class CompositionFilter implements FilterInterface $qb->andWhere($whereClause); $qb->setParameter('compositions', $data['accepted_composition']); - $qb->setParameter('ondate_composition_type_filter', + $qb->setParameter( + 'ondate_composition_type_filter', $this->rollingDateConverter->convert($data['on_date']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php index 24883b681..7ae22ddd8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php @@ -52,10 +52,12 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac } $qb->add('where', $where); - $qb->setParameter('date_from', + $qb->setParameter( + 'date_from', $this->rollingDateConverter->convert($data['date_from']) ); - $qb->setParameter('date_to', + $qb->setParameter( + 'date_to', $this->rollingDateConverter->convert($data['date_to']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php index 568995461..0ac4b3173 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php @@ -53,10 +53,12 @@ class DeathdateFilter implements ExportElementValidatedInterface, FilterInterfac } $qb->add('where', $where); - $qb->setParameter('date_from', + $qb->setParameter( + 'date_from', $this->rollingDateConverter->convert($data['date_from']) ); - $qb->setParameter('date_to', + $qb->setParameter( + 'date_to', $this->rollingDateConverter->convert($data['date_to']) ); } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php index e2bb0a09b..d641a0140 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php @@ -14,10 +14,10 @@ namespace Chill\PersonBundle\Export\Filter\PersonFilters; use Chill\MainBundle\Entity\GeographicalUnit; use Chill\MainBundle\Entity\GeographicalUnit\SimpleGeographicalUnitDTO; use Chill\MainBundle\Form\Type\PickRollingDateType; -use Chill\MainBundle\Service\RollingDate\RollingDate; -use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface; use Chill\MainBundle\Repository\GeographicalUnitRepositoryInterface; +use Chill\MainBundle\Service\RollingDate\RollingDate; +use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Chill\PersonBundle\Entity\Household\PersonHouseholdAddress; use Chill\PersonBundle\Export\Declarations; @@ -31,10 +31,10 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface private GeographicalUnitRepositoryInterface $geographicalUnitRepository; - private TranslatableStringHelperInterface $translatableStringHelper; - private RollingDateConverterInterface $rollingDateConverter; + private TranslatableStringHelperInterface $translatableStringHelper; + public function __construct( GeographicalUnitRepositoryInterface $geographicalUnitRepository, GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, @@ -75,7 +75,8 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface ->andWhere( $qb->expr()->exists($subQuery) ) - ->setParameter('person_filter_geog_date', + ->setParameter( + 'person_filter_geog_date', $this->rollingDateConverter->convert($data['date_calc']) ) ->setParameter('person_filter_geog_units', array_map(static fn (SimpleGeographicalUnitDTO $unitDTO) => $unitDTO->id, $data['units'])); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php index 2aa6e92ad..90003c6bf 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php @@ -27,10 +27,10 @@ use function in_array; class ResidentialAddressAtThirdpartyFilter implements FilterInterface { - private TranslatableStringHelper $translatableStringHelper; - private RollingDateConverterInterface $rollingDateConverter; + private TranslatableStringHelper $translatableStringHelper; + public function __construct( RollingDateConverterInterface $rollingDateConverter, TranslatableStringHelper $translatableStringHelper @@ -83,7 +83,8 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface } $qb->setParameter('type', $data['thirdparty_cat']); - $qb->setParameter('date', + $qb->setParameter( + 'date', $this->rollingDateConverter->convert($data['date_calc']) ); $qb->add('where', $where); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php index c92919ef3..bd55c5b80 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php @@ -66,7 +66,8 @@ class ResidentialAddressAtUserFilter implements FilterInterface $where = $qb->expr()->andX($clause); } - $qb->setParameter('date', + $qb->setParameter( + 'date', $this->rollingDateConverter->convert($data['date_calc']) ); $qb->add('where', $where); diff --git a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php index a7aa19ab0..79bad4f52 100644 --- a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php +++ b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php @@ -48,10 +48,12 @@ class ReportDateFilter implements FilterInterface } $qb->add('where', $where); - $qb->setParameter('report_date_filter_date_from', + $qb->setParameter( + 'report_date_filter_date_from', $this->rollingDateConverter->convert($data['date_from']) ); - $qb->setParameter('report_date_filter_date_to', + $qb->setParameter( + 'report_date_filter_date_to', $this->rollingDateConverter->convert($data['date_to']) ); }