From 0d2a487ae718bcc3478ce34bc13132db46bbd6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 11 Mar 2025 22:28:42 +0100 Subject: [PATCH] Add new normalization methods on filters, aggregators exports and formatter by applying rector rule --- .../_static/code/exports/BirthdateFilter.php | 13 ++++++++ .../_static/code/exports/CountPerson.php | 12 ++++++++ .../ByActivityNumberAggregator.php | 15 ++++++++++ .../ByActivityTypeAggregator.php | 15 ++++++++++ .../BySocialActionAggregator.php | 15 ++++++++++ .../BySocialIssueAggregator.php | 15 ++++++++++ .../Aggregator/ActivityLocationAggregator.php | 15 ++++++++++ .../Aggregator/ActivityPresenceAggregator.php | 15 ++++++++++ .../Aggregator/ActivityReasonAggregator.php | 15 ++++++++++ .../Aggregator/ActivityTypeAggregator.php | 15 ++++++++++ .../Aggregator/ActivityUserAggregator.php | 15 ++++++++++ .../Aggregator/ActivityUsersAggregator.php | 15 ++++++++++ .../Aggregator/ActivityUsersJobAggregator.php | 15 ++++++++++ .../ActivityUsersScopeAggregator.php | 15 ++++++++++ .../Export/Aggregator/ByCreatorAggregator.php | 15 ++++++++++ .../Aggregator/ByThirdpartyAggregator.php | 15 ++++++++++ .../Aggregator/CreatorJobAggregator.php | 15 ++++++++++ .../Aggregator/CreatorScopeAggregator.php | 15 ++++++++++ .../Export/Aggregator/DateAggregator.php | 15 ++++++++++ .../Aggregator/LocationTypeAggregator.php | 15 ++++++++++ .../PersonAggregators/HouseholdAggregator.php | 15 ++++++++++ .../PersonAggregators/PersonAggregator.php | 15 ++++++++++ .../Export/Aggregator/PersonsAggregator.php | 15 ++++++++++ .../Aggregator/SentReceivedAggregator.php | 15 ++++++++++ .../LinkedToACP/AvgActivityDuration.php | 15 ++++++++++ .../LinkedToACP/AvgActivityVisitDuration.php | 15 ++++++++++ .../Export/LinkedToACP/CountActivity.php | 15 ++++++++++ .../LinkedToACP/CountHouseholdOnActivity.php | 15 ++++++++++ .../LinkedToACP/CountPersonsOnActivity.php | 15 ++++++++++ .../Export/LinkedToACP/ListActivity.php | 15 ++++++++++ .../LinkedToACP/SumActivityDuration.php | 16 ++++++++-- .../LinkedToACP/SumActivityVisitDuration.php | 16 ++++++++-- .../Export/LinkedToPerson/CountActivity.php | 15 ++++++++++ .../CountHouseholdOnActivity.php | 15 ++++++++++ .../Export/LinkedToPerson/ListActivity.php | 15 ++++++++++ .../LinkedToPerson/StatActivityDuration.php | 15 ++++++++++ .../Filter/ACPFilters/ActivityTypeFilter.php | 16 ++++++++++ .../ACPFilters/BySocialActionFilter.php | 15 ++++++++++ .../Filter/ACPFilters/BySocialIssueFilter.php | 15 ++++++++++ .../Filter/ACPFilters/HasNoActivityFilter.php | 15 ++++++++++ ...PeriodHavingActivityBetweenDatesFilter.php | 15 ++++++++++ .../Export/Filter/ActivityDateFilter.php | 15 ++++++++++ .../Export/Filter/ActivityPresenceFilter.php | 17 +++++++++++ .../Export/Filter/ActivityTypeFilter.php | 17 +++++++++++ .../Export/Filter/ActivityUsersFilter.php | 17 +++++++++++ .../Export/Filter/ByCreatorFilter.php | 17 +++++++++++ .../Export/Filter/CreatorJobFilter.php | 16 ++++++++++ .../Export/Filter/CreatorScopeFilter.php | 16 ++++++++++ .../Export/Filter/EmergencyFilter.php | 15 ++++++++++ .../Export/Filter/LocationFilter.php | 17 +++++++++++ .../Export/Filter/LocationTypeFilter.php | 15 ++++++++++ .../PersonFilters/ActivityReasonFilter.php | 17 +++++++++++ .../PersonHavingActivityBetweenDateFilter.php | 15 ++++++++++ .../Export/Filter/PersonsFilter.php | 15 ++++++++++ .../Export/Filter/SentReceivedFilter.php | 15 ++++++++++ .../Export/Filter/UserFilter.php | 17 +++++++++++ .../Export/Filter/UsersJobFilter.php | 16 ++++++++++ .../Export/Filter/UsersScopeFilter.php | 16 ++++++++++ .../Aggregator/ByActivityTypeAggregator.php | 15 ++++++++++ .../Aggregator/ByLocationAggregator.php | 15 ++++++++++ .../Export/Aggregator/ByUserJobAggregator.php | 15 ++++++++++ .../Aggregator/ByUserScopeAggregator.php | 15 ++++++++++ .../Export/AvgAsideActivityDuration.php | 15 ++++++++++ .../src/Export/Export/CountAsideActivity.php | 15 ++++++++++ .../src/Export/Export/ListAsideActivity.php | 15 ++++++++++ .../Export/SumAsideActivityDuration.php | 15 ++++++++++ .../Export/Filter/ByActivityTypeFilter.php | 17 +++++++++++ .../src/Export/Filter/ByDateFilter.php | 15 ++++++++++ .../src/Export/Filter/ByLocationFilter.php | 17 +++++++++++ .../src/Export/Filter/ByUserFilter.php | 17 +++++++++++ .../src/Export/Filter/ByUserJobFilter.php | 16 ++++++++++ .../src/Export/Filter/ByUserScopeFilter.php | 16 ++++++++++ .../Export/Aggregator/AgentAggregator.php | 15 ++++++++++ .../Aggregator/CancelReasonAggregator.php | 15 ++++++++++ .../Export/Aggregator/JobAggregator.php | 15 ++++++++++ .../Export/Aggregator/LocationAggregator.php | 15 ++++++++++ .../Aggregator/LocationTypeAggregator.php | 15 ++++++++++ .../Export/Aggregator/MonthYearAggregator.php | 15 ++++++++++ .../Export/Aggregator/ScopeAggregator.php | 15 ++++++++++ .../Export/Aggregator/UrgencyAggregator.php | 15 ++++++++++ .../Export/Export/CountCalendars.php | 15 ++++++++++ .../Export/Export/StatCalendarAvgDuration.php | 15 ++++++++++ .../Export/Export/StatCalendarSumDuration.php | 15 ++++++++++ .../Export/Filter/AgentFilter.php | 17 +++++++++++ .../Export/Filter/BetweenDatesFilter.php | 15 ++++++++++ .../Export/Filter/CalendarRangeFilter.php | 15 ++++++++++ .../Export/Filter/JobFilter.php | 16 ++++++++++ .../Export/Filter/ScopeFilter.php | 16 ++++++++++ .../Export/Aggregator/EventDateAggregator.php | 15 ++++++++++ .../Export/Aggregator/EventTypeAggregator.php | 15 ++++++++++ .../Export/Aggregator/RoleAggregator.php | 15 ++++++++++ .../Export/CountEventParticipations.php | 15 ++++++++++ .../Export/Export/CountEvents.php | 15 ++++++++++ .../Export/Filter/EventDateFilter.php | 15 ++++++++++ .../Export/Filter/EventTypeFilter.php | 17 +++++++++++ .../Export/Filter/RoleFilter.php | 17 +++++++++++ .../ChillJobBundle/src/Export/ListCV.php | 16 ++++++++++ .../ChillJobBundle/src/Export/ListFrein.php | 16 ++++++++++ .../src/Export/ListProjetProfessionnel.php | 16 ++++++++++ .../SimpleGeographicalUnitDTO.php | 5 ++++ .../Export/Formatter/CSVListFormatter.php | 15 ++++++++++ .../Formatter/CSVPivotedListFormatter.php | 15 ++++++++++ .../Tests/Export/ExportManagerTest.php | 30 +++++++++++++++++++ .../Tests/Export/SortExportElementTest.php | 30 +++++++++++++++++++ .../AdministrativeLocationAggregator.php | 15 ++++++++++ .../ByActionNumberAggregator.php | 15 ++++++++++ .../ClosingDateAggregator.php | 15 ++++++++++ .../ClosingMotiveAggregator.php | 15 ++++++++++ .../ConfidentialAggregator.php | 15 ++++++++++ .../CreatorJobAggregator.php | 15 ++++++++++ .../DurationAggregator.php | 15 ++++++++++ .../EmergencyAggregator.php | 15 ++++++++++ .../EvaluationAggregator.php | 15 ++++++++++ .../GeographicalUnitStatAggregator.php | 17 +++++++++++ .../IntensityAggregator.php | 15 ++++++++++ .../JobWorkingOnCourseAggregator.php | 15 ++++++++++ .../OpeningDateAggregator.php | 15 ++++++++++ .../OriginAggregator.php | 15 ++++++++++ .../PersonParticipatingAggregator.php | 15 ++++++++++ .../ReferrerAggregator.php | 15 ++++++++++ .../ReferrerScopeAggregator.php | 15 ++++++++++ .../RequestorAggregator.php | 15 ++++++++++ .../ScopeAggregator.php | 15 ++++++++++ .../ScopeWorkingOnCourseAggregator.php | 15 ++++++++++ .../SocialActionAggregator.php | 15 ++++++++++ .../SocialIssueAggregator.php | 15 ++++++++++ .../StepAggregator.php | 15 ++++++++++ .../UserJobAggregator.php | 15 ++++++++++ .../UserWorkingOnCourseAggregator.php | 15 ++++++++++ .../ByClosingMotiveAggregator.php | 15 ++++++++++ .../ByDateAggregator.php | 15 ++++++++++ .../ByStepAggregator.php | 15 ++++++++++ .../ByEndDateAggregator.php | 15 ++++++++++ .../ByMaxDateAggregator.php | 15 ++++++++++ .../ByStartDateAggregator.php | 15 ++++++++++ .../EvaluationTypeAggregator.php | 15 ++++++++++ .../HavingEndDateAggregator.php | 15 ++++++++++ .../ChildrenNumberAggregator.php | 15 ++++++++++ .../CompositionAggregator.php | 15 ++++++++++ .../AdministrativeStatusAggregator.php | 15 ++++++++++ .../PersonAggregators/AgeAggregator.php | 15 ++++++++++ .../ByHouseholdCompositionAggregator.php | 15 ++++++++++ .../PersonAggregators/CenterAggregator.php | 15 ++++++++++ .../CountryOfBirthAggregator.php | 15 ++++++++++ .../EmploymentStatusAggregator.php | 15 ++++++++++ .../PersonAggregators/GenderAggregator.php | 15 ++++++++++ .../GeographicalUnitAggregator.php | 17 +++++++++++ .../HouseholdPositionAggregator.php | 15 ++++++++++ .../MaritalStatusAggregator.php | 15 ++++++++++ .../NationalityAggregator.php | 15 ++++++++++ .../PostalCodeAggregator.php | 15 ++++++++++ .../ActionTypeAggregator.php | 15 ++++++++++ .../CreatorAggregator.php | 15 ++++++++++ .../CreatorJobAggregator.php | 15 ++++++++++ .../CreatorScopeAggregator.php | 15 ++++++++++ .../CurrentActionAggregator.php | 15 ++++++++++ .../SocialWorkAggregators/GoalAggregator.php | 15 ++++++++++ .../GoalResultAggregator.php | 15 ++++++++++ .../HandlingThirdPartyAggregator.php | 15 ++++++++++ .../SocialWorkAggregators/JobAggregator.php | 15 ++++++++++ .../ReferrerAggregator.php | 15 ++++++++++ .../ResultAggregator.php | 15 ++++++++++ .../SocialWorkAggregators/ScopeAggregator.php | 15 ++++++++++ ...rkPersonAssociatedOnAccompanyingPeriod.php | 15 ++++++++++ ...vgDurationAPWorkPersonAssociatedOnWork.php | 15 ++++++++++ .../Export/Export/CountAccompanyingCourse.php | 5 ++++ .../CountAccompanyingCourseStepHistory.php | 15 ++++++++++ ...orkAssociatePersonOnAccompanyingPeriod.php | 15 ++++++++++ ...panyingPeriodWorkAssociatePersonOnWork.php | 15 ++++++++++ .../Export/Export/CountEvaluation.php | 15 ++++++++++ .../Export/Export/CountHouseholdInPeriod.php | 15 ++++++++++ .../Export/Export/CountPerson.php | 15 ++++++++++ ...panyingPeriodWorkAssociatePersonOnWork.php | 15 ++++++++++ .../CountPersonWithAccompanyingCourse.php | 15 ++++++++++ .../Export/Export/ListAccompanyingPeriod.php | 15 ++++++++++ ...orkAssociatePersonOnAccompanyingPeriod.php | 15 ++++++++++ ...panyingPeriodWorkAssociatePersonOnWork.php | 15 ++++++++++ .../Export/Export/ListEvaluation.php | 15 ++++++++++ .../Export/Export/ListHouseholdInPeriod.php | 15 ++++++++++ .../Export/Export/ListPerson.php | 16 ++++++++++ .../Export/Export/ListPersonDuplicate.php | 15 ++++++++++ .../ListPersonHavingAccompanyingPeriod.php | 15 ++++++++++ ...istPersonWithAccompanyingPeriodDetails.php | 15 ++++++++++ .../Export/StatAccompanyingCourseDuration.php | 15 ++++++++++ .../ActiveOnDateFilter.php | 15 ++++++++++ .../ActiveOneDayBetweenDatesFilter.php | 15 ++++++++++ .../AdministrativeLocationFilter.php | 17 +++++++++++ .../ClosingMotiveFilter.php | 17 +++++++++++ .../ConfidentialFilter.php | 15 ++++++++++ .../CreatorFilter.php | 17 +++++++++++ .../CreatorJobFilter.php | 16 ++++++++++ .../EmergencyFilter.php | 15 ++++++++++ .../EvaluationFilter.php | 17 +++++++++++ .../HasNoActionFilter.php | 15 ++++++++++ .../HasNoReferrerFilter.php | 15 ++++++++++ .../HasTemporaryLocationFilter.php | 15 ++++++++++ ...ccompanyingPeriodInfoWithinDatesFilter.php | 15 ++++++++++ .../IntensityFilter.php | 15 ++++++++++ .../JobWorkingOnCourseFilter.php | 16 ++++++++++ ...tAssociatedWithAReferenceAddressFilter.php | 15 ++++++++++ .../OpenBetweenDatesFilter.php | 15 ++++++++++ .../OriginFilter.php | 17 +++++++++++ .../ReferrerFilter.php | 16 ++++++++++ .../ReferrerFilterBetweenDates.php | 16 ++++++++++ .../RequestorFilter.php | 15 ++++++++++ .../ScopeWorkingOnCourseFilter.php | 16 ++++++++++ .../SocialActionFilter.php | 15 ++++++++++ .../SocialIssueFilter.php | 15 ++++++++++ .../StepFilterBetweenDates.php | 15 ++++++++++ .../UserJobFilter.php | 2 +- .../UserScopeFilter.php | 18 ++++++++++- .../UserWorkingOnCourseFilter.php | 19 +++++++++++- .../ByDateFilter.php | 17 ++++++++++- .../ByStepFilter.php | 17 ++++++++++- .../EvaluationFilters/ByEndDateFilter.php | 17 ++++++++++- .../EvaluationFilters/ByStartDateFilter.php | 17 ++++++++++- .../CurrentEvaluationsFilter.php | 17 ++++++++++- .../EvaluationTypeFilter.php | 19 +++++++++++- .../EvaluationFilters/MaxDateFilter.php | 17 ++++++++++- .../HouseholdFilters/CompositionFilter.php | 19 +++++++++++- .../PersonFilters/AddressRefStatusFilter.php | 17 ++++++++++- .../Export/Filter/PersonFilters/AgeFilter.php | 17 ++++++++++- .../Filter/PersonFilters/BirthdateFilter.php | 17 ++++++++++- .../ByHouseholdCompositionFilter.php | 19 +++++++++++- .../PersonFilters/DeadOrAliveFilter.php | 17 ++++++++++- .../Filter/PersonFilters/DeathdateFilter.php | 17 ++++++++++- .../Filter/PersonFilters/GenderFilter.php | 17 ++++++++++- .../PersonFilters/MaritalStatusFilter.php | 19 +++++++++++- .../PersonFilters/NationalityFilter.php | 2 +- .../ResidentialAddressAtThirdpartyFilter.php | 19 +++++++++++- .../ResidentialAddressAtUserFilter.php | 17 ++++++++++- .../WithParticipationBetweenDatesFilter.php | 17 ++++++++++- .../WithoutHouseholdComposition.php | 17 ++++++++++- ...WithoutParticipationBetweenDatesFilter.php | 17 ++++++++++- ...yingPeriodWorkEndDateBetweenDateFilter.php | 17 ++++++++++- ...ngPeriodWorkStartDateBetweenDateFilter.php | 17 ++++++++++- ...odWorkWithEvaluationBetweenDatesFilter.php | 17 ++++++++++- .../SocialWorkFilters/CreatorFilter.php | 18 ++++++++++- .../SocialWorkFilters/CreatorJobFilter.php | 18 ++++++++++- .../SocialWorkFilters/CreatorScopeFilter.php | 18 ++++++++++- .../SocialWorkFilters/CurrentActionFilter.php | 17 ++++++++++- .../Filter/SocialWorkFilters/JobFilter.php | 18 ++++++++++- .../SocialWorkFilters/ReferrerFilter.php | 18 ++++++++++- .../Filter/SocialWorkFilters/ScopeFilter.php | 18 ++++++++++- .../SocialWorkTypeFilter.php | 17 ++++++++++- .../Export/Export/ReportList.php | 18 ++++++++++- .../Export/Filter/ReportDateFilter.php | 17 ++++++++++- 247 files changed, 3794 insertions(+), 42 deletions(-) diff --git a/docs/source/_static/code/exports/BirthdateFilter.php b/docs/source/_static/code/exports/BirthdateFilter.php index 0be699383..e4d1db671 100644 --- a/docs/source/_static/code/exports/BirthdateFilter.php +++ b/docs/source/_static/code/exports/BirthdateFilter.php @@ -20,6 +20,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; // add specific role for this filter public function addRole(): ?string { @@ -74,6 +75,18 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac 'format' => 'dd-MM-yyyy', ]); } + public function getNormalizationVersion(): int + { + return 1; + } + public function normalizeFormData(array $formData): array + { + return ['date_from' => $this->normalizeDate($formData['date_from']), 'date_to' => $this->normalizeDate($formData['date_to'])]; + } + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_from' => $this->denormalizeDate($formData['date_from']), 'date_to' => $this->denormalizeDate($formData['date_to'])]; + } public function getFormDefaultData(): array { return ['date_from' => new DateTime(), 'date_to' => new DateTime()]; diff --git a/docs/source/_static/code/exports/CountPerson.php b/docs/source/_static/code/exports/CountPerson.php index 02447d335..cee16dc27 100644 --- a/docs/source/_static/code/exports/CountPerson.php +++ b/docs/source/_static/code/exports/CountPerson.php @@ -36,6 +36,18 @@ class CountPerson implements ExportInterface { // this export does not add any form } + public function getNormalizationVersion(): int + { + return 1; + } + public function normalizeFormData(array $formData): array + { + return []; + } + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php index fd97845dd..10559aa57 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php @@ -41,6 +41,21 @@ class ByActivityNumberAggregator implements AggregatorInterface // No form needed } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php index 5b2d34c41..4ba2f27c9 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php @@ -46,6 +46,21 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['after_date' => $formData['after_date']->normalize(), 'before_date' => $formData['before_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['after_date' => \Chill\MainBundle\Service\RollingDate\RollingDate::fromNormalized($formData['after_date']), 'before_date' => \Chill\MainBundle\Service\RollingDate\RollingDate::fromNormalized($formData['before_date'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php index f9b1f0513..0d50937e4 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php @@ -47,6 +47,21 @@ class BySocialActionAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php index 49e71ea4c..bde3159fc 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php @@ -47,6 +47,21 @@ class BySocialIssueAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityLocationAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityLocationAggregator.php index ab9775bf5..28c968cc0 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityLocationAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityLocationAggregator.php @@ -44,6 +44,21 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface // no form required for this aggregator } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php index b59333320..1117ddd4b 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php @@ -24,6 +24,21 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php index 90e31cd50..f3b6e0461 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php @@ -89,6 +89,21 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali ); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['level' => $formData['level']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['level' => $formData['level']]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php index feca0d52c..4164662b7 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php @@ -49,6 +49,21 @@ class ActivityTypeAggregator implements AggregatorInterface // no form required for this aggregator } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php index 216e7d432..e7a691282 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php @@ -48,6 +48,21 @@ class ActivityUserAggregator implements AggregatorInterface // nothing to add } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php index dcda7aee7..7c49f4dbd 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php @@ -48,6 +48,21 @@ class ActivityUsersAggregator implements AggregatorInterface // nothing to add on the form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php index 7a73cdabe..afa66a8f9 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php @@ -67,6 +67,21 @@ class ActivityUsersJobAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php index ee0d68502..64fa44a02 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php @@ -67,6 +67,21 @@ class ActivityUsersScopeAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php index 0c5643b00..e043ef323 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php @@ -43,6 +43,21 @@ class ByCreatorAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php index c67ae2562..605d5cfd7 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php @@ -47,6 +47,21 @@ class ByThirdpartyAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php index 2999dca6f..933670535 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php @@ -67,6 +67,21 @@ class CreatorJobAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php index 3a039e39e..0bc917657 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php @@ -67,6 +67,21 @@ class CreatorScopeAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/DateAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/DateAggregator.php index 492f5625b..ef692d3e5 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/DateAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/DateAggregator.php @@ -76,6 +76,21 @@ class DateAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['frequency' => $formData['frequency']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['frequency' => $formData['frequency']]; + } + public function getFormDefaultData(): array { return ['frequency' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php index dffd8eed6..b98313bc5 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php @@ -47,6 +47,21 @@ class LocationTypeAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/HouseholdAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/HouseholdAggregator.php index c03cceb6a..56a15bfc4 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/HouseholdAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/HouseholdAggregator.php @@ -29,6 +29,21 @@ final readonly class HouseholdAggregator implements AggregatorInterface // nothing to add here } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php index 5ec974edb..97defe25b 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php @@ -26,6 +26,21 @@ final readonly class PersonAggregator implements AggregatorInterface // nothing to add here } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php index 8e25e62d1..bec0d30d3 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php @@ -32,6 +32,21 @@ final readonly class PersonsAggregator implements AggregatorInterface // nothing to add here } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php index 7181c7c1a..5b17e52ee 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php @@ -42,6 +42,21 @@ class SentReceivedAggregator implements AggregatorInterface // No form needed } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php index fdbed74db..4e0f88dd9 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php @@ -38,6 +38,21 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php index 96f43fee0..d6ae34b6d 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php @@ -46,6 +46,21 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac // TODO: Implement buildForm() method. } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php index a4ece5abe..20c729615 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php @@ -43,6 +43,21 @@ class CountActivity implements ExportInterface, GroupedExportInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php index cf694b3b1..580856b76 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php @@ -44,6 +44,21 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php index fb3e8fd20..a0231e6f8 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php @@ -43,6 +43,21 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php index 8fe817951..744ed4d7d 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php @@ -38,6 +38,21 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa $this->helper->buildForm($builder); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php index c1784ae7e..9588d4664 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php @@ -40,9 +40,21 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) + public function buildForm(FormBuilderInterface $builder) {} + + public function getNormalizationVersion(): int { - // TODO: Implement buildForm() method. + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; } public function getFormDefaultData(): array diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php index 16f2ae94f..c9bb619bb 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php @@ -40,9 +40,21 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) + public function buildForm(FormBuilderInterface $builder) {} + + public function getNormalizationVersion(): int { - // TODO: Implement buildForm() method. + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; } public function getFormDefaultData(): array diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php index d3a493947..00d910b34 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php @@ -35,6 +35,21 @@ class CountActivity implements ExportInterface, GroupedExportInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php index 7622e9010..4abb09f73 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php @@ -36,6 +36,21 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php index 8d47cf92a..e548e70a8 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php @@ -78,6 +78,21 @@ class ListActivity implements ListInterface, GroupedExportInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['fields' => $formData['fields']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['fields' => $formData['fields']]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php index db1ac4449..a1a5c86ad 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php @@ -49,6 +49,21 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php index 803071949..40c2e2d08 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php @@ -25,6 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ActivityTypeFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp'; public function __construct( @@ -92,6 +93,21 @@ final readonly class ActivityTypeFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_activitytypes' => $this->normalizeDoctrineEntity($formData['accepted_activitytypes']), 'date_after' => $formData['date_after']->normalize(), 'date_before' => $formData['date_before']->normalize()]; + } + + 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'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php index 1ba62fe02..bd6fd253f 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php @@ -55,6 +55,21 @@ class BySocialActionFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_socialactions' => $formData['accepted_socialactions']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_socialactions' => $formData['accepted_socialactions']]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php index d09741e7e..4474962ef 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php @@ -55,6 +55,21 @@ class BySocialIssueFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_socialissues' => $formData['accepted_socialissues']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_socialissues' => $formData['accepted_socialissues']]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php index 7a7901a7f..3264220cb 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php @@ -48,6 +48,21 @@ class HasNoActivityFilter implements FilterInterface // no form needed } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php index 43f6f6724..c10ed6530 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php @@ -41,6 +41,21 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php index c9fc0ac48..7dff6159a 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php @@ -72,6 +72,21 @@ class ActivityDateFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_from' => $formData['date_from']->normalize(), 'date_to' => $formData['date_to']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_from' => RollingDate::fromNormalized($formData['date_from']), 'date_to' => RollingDate::fromNormalized($formData['date_to'])]; + } + public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php index dbd63a3be..de5ae96a0 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php @@ -23,6 +23,8 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class ActivityPresenceFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct( private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator, @@ -45,6 +47,21 @@ final readonly class ActivityPresenceFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['presences' => $this->normalizeDoctrineEntity($formData['presences'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['presences' => $this->denormalizeDoctrineEntity($formData['presences'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php index 6d9409713..303c1cba7 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php @@ -24,6 +24,8 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct( protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository, @@ -70,6 +72,21 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['types' => $this->normalizeDoctrineEntity($formData['types'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['types' => $this->denormalizeDoctrineEntity($formData['types'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php index 9b4e141dd..9f6712715 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php @@ -20,6 +20,8 @@ use Symfony\Component\Form\FormBuilderInterface; class ActivityUsersFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly UserRender $userRender) {} public function addRole(): ?string @@ -52,6 +54,21 @@ class ActivityUsersFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_users' => $this->normalizeDoctrineEntity($formData['accepted_users'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php index a2a4b08af..1e443e34c 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php @@ -20,6 +20,8 @@ use Symfony\Component\Form\FormBuilderInterface; class ByCreatorFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly UserRender $userRender) {} public function addRole(): ?string @@ -48,6 +50,21 @@ class ByCreatorFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_users' => $this->normalizeDoctrineEntity($formData['accepted_users'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php index da4585cd3..a0e85fb26 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php @@ -26,6 +26,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class CreatorJobFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acp_act_filter_creator_job'; public function __construct( @@ -90,6 +91,21 @@ final readonly class CreatorJobFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['jobs' => $this->normalizeDoctrineEntity($formData['jobs'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string'): array { $jobs = array_map( diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php index 9b6c6b549..7d2bbc3da 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php @@ -24,6 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorScopeFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acp_act_filter_creator_scope'; public function __construct( @@ -86,6 +87,21 @@ class CreatorScopeFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['scopes' => $this->normalizeDoctrineEntity($formData['scopes'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string'): array { $scopes = []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php index 5ce3e42b3..9aca6b874 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php @@ -66,6 +66,21 @@ class EmergencyFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_emergency' => $formData['accepted_emergency']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_emergency' => $formData['accepted_emergency']]; + } + public function getFormDefaultData(): array { return ['accepted_emergency' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/LocationFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/LocationFilter.php index 91dc90639..786f9ddcd 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/LocationFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/LocationFilter.php @@ -19,6 +19,8 @@ use Symfony\Component\Form\FormBuilderInterface; class LocationFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function addRole(): ?string { return null; @@ -46,6 +48,21 @@ class LocationFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_location' => $this->normalizeDoctrineEntity($formData['accepted_location'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_location' => $this->denormalizeDoctrineEntity($formData['accepted_location'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php index b91dc9a5f..0df289220 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php @@ -60,6 +60,21 @@ class LocationTypeFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_locationtype' => $formData['accepted_locationtype']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_locationtype' => $formData['accepted_locationtype']]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php index cbbf247db..e9f18ae01 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php @@ -26,6 +26,8 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(protected TranslatableStringHelper $translatableStringHelper, protected ActivityReasonRepository $activityReasonRepository) {} public function addRole(): ?string @@ -70,6 +72,21 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['reasons' => $this->normalizeDoctrineEntity($formData['reasons'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['reasons' => $this->denormalizeDoctrineEntity($formData['reasons'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php index af887fa41..f2bff9d04 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php @@ -116,6 +116,21 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem } } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_from_rolling' => $formData['date_from_rolling']->normalize(), 'date_to_rolling' => $formData['date_to_rolling']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_from_rolling' => RollingDate::fromNormalized($formData['date_from_rolling']), 'date_to_rolling' => RollingDate::fromNormalized($formData['date_to_rolling'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php index 65fda2723..ad6074462 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php @@ -60,6 +60,21 @@ final readonly class PersonsFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_persons' => $formData['accepted_persons']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_persons' => $formData['accepted_persons']]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php index 223c383c3..bbdd7a1f7 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php @@ -68,6 +68,21 @@ class SentReceivedFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_sentreceived' => $formData['accepted_sentreceived']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_sentreceived' => $formData['accepted_sentreceived']]; + } + public function getFormDefaultData(): array { return ['accepted_sentreceived' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php index f8fb4b55e..6fd807846 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php @@ -21,6 +21,8 @@ use Symfony\Component\Form\FormBuilderInterface; class UserFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly UserRender $userRender) {} public function addRole(): ?string @@ -57,6 +59,21 @@ class UserFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_users' => $this->normalizeDoctrineEntity($formData['accepted_users'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php index 3f3cecc2f..c99a7ea16 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php @@ -25,6 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface; class UsersJobFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'act_filter_user_job'; public function __construct( @@ -77,6 +78,21 @@ class UsersJobFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['jobs' => $this->normalizeDoctrineEntity($formData['jobs'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string') { return ['export.filter.activity.by_users_job.Filtered activity by users job: only %jobs%', [ diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php index bac5285b2..eebf92a40 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php @@ -25,6 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface; class UsersScopeFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'act_filter_user_scope'; public function __construct( @@ -77,6 +78,21 @@ class UsersScopeFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['scopes' => $this->normalizeDoctrineEntity($formData['scopes'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string'): array { return ['export.filter.activity.by_users_scope.Filtered activity by users scope: only %scopes%', [ diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php index 97e4e3142..04524e962 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php @@ -46,6 +46,21 @@ class ByActivityTypeAggregator implements AggregatorInterface // No form needed } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php index 92be59e4a..c90ecfdaa 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php @@ -26,6 +26,21 @@ class ByLocationAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php index 9c905db09..73d1e65cd 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php @@ -67,6 +67,21 @@ class ByUserJobAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php index 491a2a22c..b607fa822 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php @@ -66,6 +66,21 @@ class ByUserScopeAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php index 4b273908c..3f2a615b0 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php @@ -26,6 +26,21 @@ class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterfac public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php index 7ac0f8a96..9982591f2 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php @@ -26,6 +26,21 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php index 978101edf..9aaab9be5 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php @@ -46,6 +46,21 @@ final readonly class ListAsideActivity implements ListInterface, GroupedExportIn public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php index 31b28b32a..7207147a4 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php @@ -26,6 +26,21 @@ class SumAsideActivityDuration implements ExportInterface, GroupedExportInterfac public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php index 8be71cf25..33057249c 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php @@ -24,6 +24,8 @@ use Symfony\Component\Form\FormBuilderInterface; class ByActivityTypeFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct( private readonly CategoryRender $categoryRender, private readonly TranslatableStringHelperInterface $translatableStringHelper, @@ -68,6 +70,21 @@ class ByActivityTypeFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['types' => $this->normalizeDoctrineEntity($formData['types'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['types' => $this->denormalizeDoctrineEntity($formData['types'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php index 25cc614b8..c3877dd67 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php @@ -64,6 +64,21 @@ class ByDateFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_from' => $formData['date_from']->normalize(), 'date_to' => $formData['date_to']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_from' => RollingDate::fromNormalized($formData['date_from']), 'date_to' => RollingDate::fromNormalized($formData['date_to'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php index 4b82b1711..3569ed1d4 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php @@ -23,6 +23,8 @@ use Symfony\Component\Security\Core\Security; final readonly class ByLocationFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct( private Security $security, ) {} @@ -38,6 +40,21 @@ final readonly class ByLocationFilter implements FilterInterface ->add('locations', PickUserLocationType::class); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['locations' => $this->normalizeDoctrineEntity($formData['locations'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['locations' => $this->denormalizeDoctrineEntity($formData['locations'], $this->someRepository)]; + } + public function getFormDefaultData(): array { $user = $this->security->getUser(); diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php index b2d086a56..73d690752 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php @@ -20,6 +20,8 @@ use Symfony\Component\Form\FormBuilderInterface; class ByUserFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly UserRender $userRender) {} public function addRole(): ?string @@ -49,6 +51,21 @@ class ByUserFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_users' => $this->normalizeDoctrineEntity($formData['accepted_users'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_users' => $this->denormalizeDoctrineEntity($formData['accepted_users'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php index 0a74961d8..2042de6ce 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php @@ -25,6 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByUserJobFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'aside_act_filter_user_job'; public function __construct( @@ -77,6 +78,21 @@ class ByUserJobFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['jobs' => $this->normalizeDoctrineEntity($formData['jobs'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string'): array { return ['export.filter.by_user_job.Filtered aside activities by user jobs: only %jobs%', [ diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php index 0d1dff542..71cb2e8ea 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php @@ -25,6 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByUserScopeFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'aside_act_filter_user_scope'; public function __construct( @@ -77,6 +78,21 @@ class ByUserScopeFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['scopes' => $this->normalizeDoctrineEntity($formData['scopes'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string') { return ['export.filter.by_user_scope.Filtered aside activities by user scope: only %scopes%', [ diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php index 73dd9ec08..735142ee1 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php @@ -47,6 +47,21 @@ final readonly class AgentAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php index 9588dcd83..f34b5c8f4 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php @@ -48,6 +48,21 @@ class CancelReasonAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php index c2d6a7b58..b4145c9b2 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php @@ -67,6 +67,21 @@ final readonly class JobAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php index 1f1209a04..07f8debb3 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php @@ -45,6 +45,21 @@ final readonly class LocationAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php index fd276f7df..2b7a0ba33 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php @@ -47,6 +47,21 @@ final readonly class LocationTypeAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php index 84cf5d9d7..cb797a882 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php @@ -40,6 +40,21 @@ class MonthYearAggregator implements AggregatorInterface // No form needed } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php index 22a4f87ad..c2070bdff 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php @@ -67,6 +67,21 @@ final readonly class ScopeAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php index 1a1eb0041..a5d4e5fc7 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php @@ -49,6 +49,21 @@ class UrgencyAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php index 96db62bfb..f3a1e8fcc 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php @@ -34,6 +34,21 @@ class CountCalendars implements ExportInterface, GroupedExportInterface // No form necessary } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php index c01d7018c..36b040ac0 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php @@ -31,6 +31,21 @@ class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface // no form needed } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php index d5aa38a5b..53e042ece 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php @@ -31,6 +31,21 @@ class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface // no form needed } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php index 00bc1dd91..edbe4eebc 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php @@ -22,6 +22,8 @@ use Symfony\Component\Form\FormBuilderInterface; class AgentFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly UserRender $userRender) {} public function addRole(): ?string @@ -59,6 +61,21 @@ class AgentFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_agents' => $this->normalizeDoctrineEntity($formData['accepted_agents'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_agents' => $this->denormalizeDoctrineEntity($formData['accepted_agents'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php index 8558148e9..2ab113971 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php @@ -59,6 +59,21 @@ class BetweenDatesFilter implements FilterInterface ->add('date_to', PickRollingDateType::class, []); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_from' => $formData['date_from']->normalize(), 'date_to' => $formData['date_to']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_from' => RollingDate::fromNormalized($formData['date_from']), 'date_to' => RollingDate::fromNormalized($formData['date_to'])]; + } + public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php index cb9da307c..e646f8fc1 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php @@ -66,6 +66,21 @@ class CalendarRangeFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['hasCalendarRange' => $formData['hasCalendarRange']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['hasCalendarRange' => $formData['hasCalendarRange']]; + } + public function getFormDefaultData(): array { return ['hasCalendarRange' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php index b37e30735..1967faefc 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php @@ -24,6 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class JobFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'cal_filter_job'; public function __construct( @@ -84,6 +85,21 @@ final readonly class JobFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['job' => $this->normalizeDoctrineEntity($formData['job'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['job' => $this->denormalizeDoctrineEntity($formData['job'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string'): array { $userJobs = []; diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php index 0d9f756c0..954aa752e 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php @@ -25,6 +25,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ScopeFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'cal_filter_scope'; public function __construct( @@ -86,6 +87,21 @@ class ScopeFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['scope' => $this->normalizeDoctrineEntity($formData['scope'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['scope' => $this->denormalizeDoctrineEntity($formData['scope'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string'): array { $scopes = []; diff --git a/src/Bundle/ChillEventBundle/Export/Aggregator/EventDateAggregator.php b/src/Bundle/ChillEventBundle/Export/Aggregator/EventDateAggregator.php index a66025ced..d332f2acc 100644 --- a/src/Bundle/ChillEventBundle/Export/Aggregator/EventDateAggregator.php +++ b/src/Bundle/ChillEventBundle/Export/Aggregator/EventDateAggregator.php @@ -76,6 +76,21 @@ class EventDateAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['frequency' => $formData['frequency']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['frequency' => $formData['frequency']]; + } + public function getFormDefaultData(): array { return ['frequency' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillEventBundle/Export/Aggregator/EventTypeAggregator.php b/src/Bundle/ChillEventBundle/Export/Aggregator/EventTypeAggregator.php index ae080dc9d..753040493 100644 --- a/src/Bundle/ChillEventBundle/Export/Aggregator/EventTypeAggregator.php +++ b/src/Bundle/ChillEventBundle/Export/Aggregator/EventTypeAggregator.php @@ -49,6 +49,21 @@ class EventTypeAggregator implements AggregatorInterface // no form required for this aggregator } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillEventBundle/Export/Aggregator/RoleAggregator.php b/src/Bundle/ChillEventBundle/Export/Aggregator/RoleAggregator.php index 4ff3e5378..3731ce34c 100644 --- a/src/Bundle/ChillEventBundle/Export/Aggregator/RoleAggregator.php +++ b/src/Bundle/ChillEventBundle/Export/Aggregator/RoleAggregator.php @@ -49,6 +49,21 @@ class RoleAggregator implements AggregatorInterface // no form required for this aggregator } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillEventBundle/Export/Export/CountEventParticipations.php b/src/Bundle/ChillEventBundle/Export/Export/CountEventParticipations.php index e83d26c49..49b011262 100644 --- a/src/Bundle/ChillEventBundle/Export/Export/CountEventParticipations.php +++ b/src/Bundle/ChillEventBundle/Export/Export/CountEventParticipations.php @@ -36,6 +36,21 @@ readonly class CountEventParticipations implements ExportInterface, GroupedExpor public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php b/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php index 442df2ddb..7beccf766 100644 --- a/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php +++ b/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php @@ -36,6 +36,21 @@ readonly class CountEvents implements ExportInterface, GroupedExportInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillEventBundle/Export/Filter/EventDateFilter.php b/src/Bundle/ChillEventBundle/Export/Filter/EventDateFilter.php index aa6501b09..256acf52b 100644 --- a/src/Bundle/ChillEventBundle/Export/Filter/EventDateFilter.php +++ b/src/Bundle/ChillEventBundle/Export/Filter/EventDateFilter.php @@ -72,6 +72,21 @@ class EventDateFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_from' => $formData['date_from']->normalize(), 'date_to' => $formData['date_to']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_from' => RollingDate::fromNormalized($formData['date_from']), 'date_to' => RollingDate::fromNormalized($formData['date_to'])]; + } + public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillEventBundle/Export/Filter/EventTypeFilter.php b/src/Bundle/ChillEventBundle/Export/Filter/EventTypeFilter.php index 95e4474a8..e9c7d7811 100644 --- a/src/Bundle/ChillEventBundle/Export/Filter/EventTypeFilter.php +++ b/src/Bundle/ChillEventBundle/Export/Filter/EventTypeFilter.php @@ -24,6 +24,8 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class EventTypeFilter implements ExportElementValidatedInterface, FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct( protected TranslatableStringHelperInterface $translatableStringHelper, protected EventTypeRepository $eventTypeRepository, @@ -61,6 +63,21 @@ class EventTypeFilter implements ExportElementValidatedInterface, FilterInterfac ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['types' => $this->normalizeDoctrineEntity($formData['types'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['types' => $this->denormalizeDoctrineEntity($formData['types'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillEventBundle/Export/Filter/RoleFilter.php b/src/Bundle/ChillEventBundle/Export/Filter/RoleFilter.php index 923d98287..2c3161b46 100644 --- a/src/Bundle/ChillEventBundle/Export/Filter/RoleFilter.php +++ b/src/Bundle/ChillEventBundle/Export/Filter/RoleFilter.php @@ -24,6 +24,8 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class RoleFilter implements ExportElementValidatedInterface, FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct( protected TranslatableStringHelperInterface $translatableStringHelper, protected RoleRepository $roleRepository, @@ -61,6 +63,21 @@ class RoleFilter implements ExportElementValidatedInterface, FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['part_roles' => $this->normalizeDoctrineEntity($formData['part_roles'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['part_roles' => $this->denormalizeDoctrineEntity($formData['part_roles'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillJobBundle/src/Export/ListCV.php b/src/Bundle/ChillJobBundle/src/Export/ListCV.php index 9aab4e94d..210181c25 100644 --- a/src/Bundle/ChillJobBundle/src/Export/ListCV.php +++ b/src/Bundle/ChillJobBundle/src/Export/ListCV.php @@ -33,6 +33,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; */ class ListCV implements ListInterface, ExportElementValidatedInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; /** * @var array */ @@ -132,6 +133,21 @@ class ListCV implements ListInterface, ExportElementValidatedInterface ; } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['fields' => $formData['fields'], 'reportdate_min' => $this->normalizeDate($formData['reportdate_min']), 'reportdate_max' => $this->normalizeDate($formData['reportdate_max'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['fields' => $formData['fields'], 'reportdate_min' => $this->denormalizeDate($formData['reportdate_min']), 'reportdate_max' => $this->denormalizeDate($formData['reportdate_max'])]; + } + /** * Return the Export's type. This will inform _on what_ export will apply. * Most of the type, it will be a string which references an entity. diff --git a/src/Bundle/ChillJobBundle/src/Export/ListFrein.php b/src/Bundle/ChillJobBundle/src/Export/ListFrein.php index ec1f4c5b7..5fcb33195 100644 --- a/src/Bundle/ChillJobBundle/src/Export/ListFrein.php +++ b/src/Bundle/ChillJobBundle/src/Export/ListFrein.php @@ -34,6 +34,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; */ class ListFrein implements ListInterface, ExportElementValidatedInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; /** * @var array */ @@ -145,6 +146,21 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface ; } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['fields' => $formData['fields'], 'reportdate_min' => $this->normalizeDate($formData['reportdate_min']), 'reportdate_max' => $this->normalizeDate($formData['reportdate_max'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['fields' => $formData['fields'], 'reportdate_min' => $this->denormalizeDate($formData['reportdate_min']), 'reportdate_max' => $this->denormalizeDate($formData['reportdate_max'])]; + } + /** * Return the Export's type. This will inform _on what_ export will apply. * Most of the type, it will be a string which references an entity. diff --git a/src/Bundle/ChillJobBundle/src/Export/ListProjetProfessionnel.php b/src/Bundle/ChillJobBundle/src/Export/ListProjetProfessionnel.php index f9357b1c3..b3a19df0c 100644 --- a/src/Bundle/ChillJobBundle/src/Export/ListProjetProfessionnel.php +++ b/src/Bundle/ChillJobBundle/src/Export/ListProjetProfessionnel.php @@ -34,6 +34,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; */ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; /** * @var array */ @@ -151,6 +152,21 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn ; } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['fields' => $formData['fields'], 'reportdate_min' => $this->normalizeDate($formData['reportdate_min']), 'reportdate_max' => $this->normalizeDate($formData['reportdate_max'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['fields' => $formData['fields'], 'reportdate_min' => $this->denormalizeDate($formData['reportdate_min']), 'reportdate_max' => $this->denormalizeDate($formData['reportdate_max'])]; + } + /** * Return the Export's type. This will inform _on what_ export will apply. * Most of the type, it will be a string which references an entity. diff --git a/src/Bundle/ChillMainBundle/Entity/GeographicalUnit/SimpleGeographicalUnitDTO.php b/src/Bundle/ChillMainBundle/Entity/GeographicalUnit/SimpleGeographicalUnitDTO.php index 481b530d9..2d7028d21 100644 --- a/src/Bundle/ChillMainBundle/Entity/GeographicalUnit/SimpleGeographicalUnitDTO.php +++ b/src/Bundle/ChillMainBundle/Entity/GeographicalUnit/SimpleGeographicalUnitDTO.php @@ -50,4 +50,9 @@ class SimpleGeographicalUnitDTO #[Serializer\Groups(['read'])] public int $layerId, ) {} + + public function getId(): int + { + return $this->id; + } } diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php index fda49f202..0bd4c6713 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php @@ -81,6 +81,21 @@ class CSVListFormatter implements FormatterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['numerotation' => $formData['numerotation']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['numerotation' => $formData['numerotation']]; + } + public function getFormDefaultData(array $aggregatorAliases): array { return ['numerotation' => true]; diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php index 9385f1b61..ce8f44f0a 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php @@ -80,6 +80,21 @@ class CSVPivotedListFormatter implements FormatterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['numerotation' => $formData['numerotation']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['numerotation' => $formData['numerotation']]; + } + public function getFormDefaultData(array $aggregatorAliases): array { return ['numerotation' => true]; diff --git a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php index 046a239a6..a81e0fb2a 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php @@ -541,6 +541,21 @@ class DummyFilterWithApplying implements FilterInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; @@ -581,6 +596,21 @@ class DummyExport implements ExportInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php b/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php index a1bc98b0b..210372658 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php @@ -121,6 +121,21 @@ class SortExportElementTest extends KernelTestCase public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; @@ -167,6 +182,21 @@ class SortExportElementTest extends KernelTestCase public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php index 8869c98d3..31f11376c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php @@ -47,6 +47,21 @@ class AdministrativeLocationAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php index 3d940cfa1..1e4172d74 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php @@ -40,6 +40,21 @@ class ByActionNumberAggregator implements AggregatorInterface // No form needed } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php index fde692593..c2950e812 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php @@ -39,6 +39,21 @@ final readonly class ClosingDateAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['frequency' => $formData['frequency']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['frequency' => $formData['frequency']]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php index 4bf57374b..49a08156a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php @@ -43,6 +43,21 @@ class ClosingMotiveAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php index b78526e25..afb3015b8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php @@ -42,6 +42,21 @@ class ConfidentialAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php index 1cb3c7927..b14e78d87 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php @@ -80,6 +80,21 @@ class CreatorJobAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php index f7837f03e..ed434884d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php @@ -65,6 +65,21 @@ final readonly class DurationAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['precision' => $formData['precision']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['precision' => $formData['precision']]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php index 29c2d87d1..e81835f34 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php @@ -42,6 +42,21 @@ class EmergencyAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php index 8337dbfe9..0ff4f0b70 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php @@ -51,6 +51,21 @@ final readonly class EvaluationAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php index 1a52f6278..f2d752969 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php @@ -28,6 +28,8 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class GeographicalUnitStatAggregator implements AggregatorInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) {} public function addRole(): ?string @@ -123,6 +125,21 @@ final readonly class GeographicalUnitStatAggregator implements AggregatorInterfa ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_calc' => $formData['date_calc']->normalize(), 'level' => $this->normalizeDoctrineEntity($formData['level'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_calc' => RollingDate::fromNormalized($formData['date_calc']), 'level' => $this->denormalizeDoctrineEntity($formData['level'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php index fefe6b30d..c6df6c795 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php @@ -42,6 +42,21 @@ class IntensityAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php index 69241925d..80c82f782 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php @@ -74,6 +74,21 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php index 92e33eba5..ee6bab7b7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php @@ -39,6 +39,21 @@ final readonly class OpeningDateAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['frequency' => $formData['frequency']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['frequency' => $formData['frequency']]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php index c9f9bdd60..1600cb20f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php @@ -56,6 +56,21 @@ final readonly class OriginAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregator.php index 33bb09b48..a4539da2f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregator.php @@ -30,6 +30,21 @@ final readonly class PersonParticipatingAggregator implements AggregatorInterfac // nothing to do here } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php index fbe7ee34e..6ed55c18f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php @@ -79,6 +79,21 @@ final readonly class ReferrerAggregator implements AggregatorInterface, DataTran ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php index fcc68b54d..d11c12d2e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php @@ -89,6 +89,21 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface, DataTrans ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php index eca4e0b9f..0909f6e63 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php @@ -63,6 +63,21 @@ final readonly class RequestorAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php index 564d17b57..ea351f6e0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php @@ -47,6 +47,21 @@ final readonly class ScopeAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php index 15576c510..175b53cd6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php @@ -74,6 +74,21 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php index 06887d7bc..8783e54d0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php @@ -48,6 +48,21 @@ final readonly class SocialActionAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php index 4fb117980..91afd7fde 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php @@ -48,6 +48,21 @@ final readonly class SocialIssueAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php index ef005ad2d..ad013422b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php @@ -68,6 +68,21 @@ final readonly class StepAggregator implements AggregatorInterface $builder->add('on_date', PickRollingDateType::class, []); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['on_date' => $formData['on_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['on_date' => RollingDate::fromNormalized($formData['on_date'])]; + } + public function getFormDefaultData(): array { return ['on_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php index d0f4eddd6..4da1e00b5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php @@ -89,6 +89,21 @@ final readonly class UserJobAggregator implements AggregatorInterface, DataTrans ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php index ce7723b93..b8dd0d4d8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php @@ -34,6 +34,21 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac // nothing to add here } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregator.php index 0b14b3db7..c341c480a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregator.php @@ -32,6 +32,21 @@ final readonly class ByClosingMotiveAggregator implements AggregatorInterface // nothing to add here } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregator.php index df0cec2fe..f4e65e42a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregator.php @@ -39,6 +39,21 @@ final readonly class ByDateAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['frequency' => $formData['frequency']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['frequency' => $formData['frequency']]; + } + public function getFormDefaultData(): array { return ['frequency' => DateGroupingChoiceEnum::YEAR->value]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregator.php index ff1e06344..966c1e8e5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregator.php @@ -34,6 +34,21 @@ final readonly class ByStepAggregator implements AggregatorInterface // nothing in this form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php index b2bf6468f..5db4aa13c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php @@ -61,6 +61,21 @@ final class ByEndDateAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['frequency' => $formData['frequency']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['frequency' => $formData['frequency']]; + } + public function getFormDefaultData(): array { return ['frequency' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php index a1de882b7..bc8080b4d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php @@ -61,6 +61,21 @@ final class ByMaxDateAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['frequency' => $formData['frequency']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['frequency' => $formData['frequency']]; + } + public function getFormDefaultData(): array { return ['frequency' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php index a510af3b7..ed490b1cd 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php @@ -61,6 +61,21 @@ final class ByStartDateAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['frequency' => $formData['frequency']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['frequency' => $formData['frequency']]; + } + public function getFormDefaultData(): array { return ['frequency' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php index 1325b2868..7877357d6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php @@ -43,6 +43,21 @@ class EvaluationTypeAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php index 054dd4a74..6304f5f9c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php @@ -43,6 +43,21 @@ class HavingEndDateAggregator implements AggregatorInterface // No form needed } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php index b748b90d5..aa6165432 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php @@ -63,6 +63,21 @@ class ChildrenNumberAggregator implements AggregatorInterface $builder->add('on_date', PickRollingDateType::class, []); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['on_date' => $formData['on_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['on_date' => RollingDate::fromNormalized($formData['on_date'])]; + } + public function getFormDefaultData(): array { return ['on_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php index 54ea373e4..8224db8ce 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php @@ -65,6 +65,21 @@ class CompositionAggregator implements AggregatorInterface $builder->add('on_date', PickRollingDateType::class, []); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['on_date' => $formData['on_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['on_date' => RollingDate::fromNormalized($formData['on_date'])]; + } + public function getFormDefaultData(): array { return ['on_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AdministrativeStatusAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AdministrativeStatusAggregator.php index 87fd4ecb2..77d1ec1de 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AdministrativeStatusAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AdministrativeStatusAggregator.php @@ -42,6 +42,21 @@ final readonly class AdministrativeStatusAggregator implements AggregatorInterfa public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php index 86419ca51..9ef38b188 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php @@ -50,6 +50,21 @@ final readonly class AgeAggregator implements AggregatorInterface, ExportElement ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_age_calculation' => $formData['date_age_calculation']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_age_calculation' => RollingDate::fromNormalized($formData['date_age_calculation'])]; + } + public function getFormDefaultData(): array { return ['date_age_calculation' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php index 95897bba0..ca3f5b62d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php @@ -83,6 +83,21 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_calc' => $formData['date_calc']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_calc' => RollingDate::fromNormalized($formData['date_calc'])]; + } + public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php index 092b0233b..7bac2044d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php @@ -36,6 +36,21 @@ final readonly class CenterAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['at_date' => $formData['at_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['at_date' => RollingDate::fromNormalized($formData['at_date'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php index 278f52d3c..872802f4d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php @@ -92,6 +92,21 @@ final readonly class CountryOfBirthAggregator implements AggregatorInterface, Ex ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['group_by_level' => $formData['group_by_level']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['group_by_level' => $formData['group_by_level']]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/EmploymentStatusAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/EmploymentStatusAggregator.php index ebb1757ba..6130cd9e3 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/EmploymentStatusAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/EmploymentStatusAggregator.php @@ -42,6 +42,21 @@ final readonly class EmploymentStatusAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php index 3315501c4..cdb9c772b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php @@ -43,6 +43,21 @@ final readonly class GenderAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php index f16e03b09..523c4576d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php @@ -26,6 +26,8 @@ use Symfony\Component\Form\FormBuilderInterface; 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 addRole(): ?string @@ -96,6 +98,21 @@ class GeographicalUnitAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_calc' => $formData['date_calc']->normalize(), 'level' => $this->normalizeDoctrineEntity($formData['level'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_calc' => RollingDate::fromNormalized($formData['date_calc']), 'level' => $this->denormalizeDoctrineEntity($formData['level'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php index e4eaa8275..3f7d483f2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php @@ -74,6 +74,21 @@ final readonly class HouseholdPositionAggregator implements AggregatorInterface, ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_position' => $formData['date_position']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_position' => RollingDate::fromNormalized($formData['date_position'])]; + } + public function getFormDefaultData(): array { return ['date_position' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php index 27e4db504..423294459 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php @@ -47,6 +47,21 @@ final readonly class MaritalStatusAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php index 60ad5816e..4a92a9eab 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php @@ -87,6 +87,21 @@ final readonly class NationalityAggregator implements AggregatorInterface, Expor ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['group_by_level' => $formData['group_by_level']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['group_by_level' => $formData['group_by_level']]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php index 748817290..401d85ae7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php @@ -36,6 +36,21 @@ final readonly class PostalCodeAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['calc_date' => $formData['calc_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['calc_date' => RollingDate::fromNormalized($formData['calc_date'])]; + } + public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php index 552aa3ab2..c09d35a2b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php @@ -56,6 +56,21 @@ final readonly class ActionTypeAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php index db4f068c9..4a91c25e9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php @@ -48,6 +48,21 @@ class CreatorAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php index bef14f866..6ebffe923 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php @@ -65,6 +65,21 @@ class CreatorJobAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php index 88d82e7ef..b80c0d014 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php @@ -65,6 +65,21 @@ class CreatorScopeAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php index ff4ed4965..faaa2b815 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php @@ -46,6 +46,21 @@ class CurrentActionAggregator implements AggregatorInterface // No form needed } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php index 9fa575edc..65d7fed02 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php @@ -47,6 +47,21 @@ final readonly class GoalAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php index 92f03988f..c8719d41a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php @@ -53,6 +53,21 @@ class GoalResultAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php index c606328b5..86f16c2aa 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php @@ -32,6 +32,21 @@ final readonly class HandlingThirdPartyAggregator implements AggregatorInterface // no form needed here } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php index fe0f8de8f..5c64a58f1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php @@ -60,6 +60,21 @@ final readonly class JobAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php index caa22831e..538d200b4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php @@ -63,6 +63,21 @@ final readonly class ReferrerAggregator implements AggregatorInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['referrer_at' => $formData['referrer_at']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['referrer_at' => RollingDate::fromNormalized($formData['referrer_at'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php index 0060f437f..6512bb8d6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php @@ -47,6 +47,21 @@ final readonly class ResultAggregator implements AggregatorInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php index 65e1efec6..73a7e269f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php @@ -60,6 +60,21 @@ final readonly class ScopeAggregator implements AggregatorInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php index 3b8dfed77..9bd7f4383 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php @@ -36,6 +36,21 @@ class AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod implements ExportInt public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php index bdb1e0b9a..6df374498 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php @@ -36,6 +36,21 @@ class AvgDurationAPWorkPersonAssociatedOnWork implements ExportInterface, Groupe public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php index 6c75e9726..98f8e56c8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php @@ -45,6 +45,11 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface // Nothing to add here } + public function getNormalizationVersion(): int + { + return 1; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourseStepHistory.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourseStepHistory.php index 8891c7299..b4f5cc83d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourseStepHistory.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourseStepHistory.php @@ -44,6 +44,21 @@ class CountAccompanyingCourseStepHistory implements ExportInterface, GroupedExpo // Nothing to add here } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php index 70ac19ae8..c61aa4483 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php @@ -41,6 +41,21 @@ class CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod implements // No form necessary? } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWork.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWork.php index 8c9c514b3..81cb2d335 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWork.php @@ -41,6 +41,21 @@ class CountAccompanyingPeriodWorkAssociatePersonOnWork implements ExportInterfac // No form necessary? } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php index ffa993eec..cd9c2eb5b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php @@ -37,6 +37,21 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface public function buildForm(FormBuilderInterface $builder) {} + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountHouseholdInPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/CountHouseholdInPeriod.php index 36702cde8..16a884dc3 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountHouseholdInPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountHouseholdInPeriod.php @@ -49,6 +49,21 @@ class CountHouseholdInPeriod implements ExportInterface, GroupedExportInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['calc_date' => $formData['calc_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['calc_date' => RollingDate::fromNormalized($formData['calc_date'])]; + } + public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php index 9fb23bb0b..8251863bd 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php @@ -39,6 +39,21 @@ class CountPerson implements ExportInterface, GroupedExportInterface // No form necessary } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork.php index 99267afa0..f2369a304 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork.php @@ -41,6 +41,21 @@ class CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork implements Export // No form necessary? } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php index 3d611faca..922f4e8b0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php @@ -43,6 +43,21 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor // TODO: Implement buildForm() method. } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php index 399c6001f..1b9d2d7b7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php @@ -46,6 +46,21 @@ final readonly class ListAccompanyingPeriod implements ListInterface, GroupedExp ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['calc_date' => $formData['calc_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['calc_date' => RollingDate::fromNormalized($formData['calc_date'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php index 5c917ec86..fe5ef0866 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php @@ -103,6 +103,21 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeri ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['calc_date' => $formData['calc_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['calc_date' => RollingDate::fromNormalized($formData['calc_date'])]; + } + public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php index 207287962..c9b61f512 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php @@ -103,6 +103,21 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnWork implements ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['calc_date' => $formData['calc_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['calc_date' => RollingDate::fromNormalized($formData['calc_date'])]; + } + public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php index ab25ba5df..f1f80bc75 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php @@ -93,6 +93,21 @@ final readonly class ListEvaluation implements ListInterface, GroupedExportInter ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['calc_date' => $formData['calc_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['calc_date' => RollingDate::fromNormalized($formData['calc_date'])]; + } + public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php index 2246d2a95..4ae829bea 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php @@ -67,6 +67,21 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['calc_date' => $formData['calc_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['calc_date' => RollingDate::fromNormalized($formData['calc_date'])]; + } + public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php index 1613c1206..131835d84 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php @@ -33,6 +33,7 @@ use Symfony\Component\Form\FormBuilderInterface; */ class ListPerson implements ListInterface, GroupedExportInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private array $slugs = []; private readonly bool $filterStatsByCenters; @@ -56,6 +57,21 @@ class ListPerson implements ListInterface, GroupedExportInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['address_date' => $this->normalizeDate($formData['address_date'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['address_date' => $this->denormalizeDate($formData['address_date'])]; + } + public function getFormDefaultData(): array { return ['address_date' => new \DateTimeImmutable()]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php index d1761faf8..c20294e9b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php @@ -65,6 +65,21 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['precision' => $formData['precision']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['precision' => $formData['precision']]; + } + public function getFormDefaultData(): array { return ['precision' => self::PRECISION_DEFAULT_VALUE]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonHavingAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonHavingAccompanyingPeriod.php index ba6cc7a7d..c5e848eae 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonHavingAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonHavingAccompanyingPeriod.php @@ -56,6 +56,21 @@ final readonly class ListPersonHavingAccompanyingPeriod implements ListInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['address_date_rolling' => $formData['address_date_rolling']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['address_date_rolling' => RollingDate::fromNormalized($formData['address_date_rolling'])]; + } + public function getFormDefaultData(): array { return ['address_date_rolling' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php index cd522f4dd..83afeb962 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php @@ -51,6 +51,21 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['address_date' => $formData['address_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['address_date' => RollingDate::fromNormalized($formData['address_date'])]; + } + public function getFormDefaultData(): array { return ['address_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php index 650bbb9d6..b9047585e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php @@ -51,6 +51,21 @@ final readonly class StatAccompanyingCourseDuration implements ExportInterface, ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['closingdate_rolling' => $formData['closingdate_rolling']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['closingdate_rolling' => RollingDate::fromNormalized($formData['closingdate_rolling'])]; + } + public function getFormDefaultData(): array { return ['closingdate_rolling' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php index af03f3638..8a265ef0a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php @@ -65,6 +65,21 @@ class ActiveOnDateFilter implements FilterInterface ->add('on_date', PickRollingDateType::class, []); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['on_date' => $formData['on_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['on_date' => RollingDate::fromNormalized($formData['on_date'])]; + } + public function getFormDefaultData(): array { return ['on_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php index b0c0cf536..611ae7bb6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php @@ -55,6 +55,21 @@ class ActiveOneDayBetweenDatesFilter implements FilterInterface ->add('date_to', PickRollingDateType::class, []); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_from' => $formData['date_from']->normalize(), 'date_to' => $formData['date_to']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_from' => RollingDate::fromNormalized($formData['date_from']), 'date_to' => RollingDate::fromNormalized($formData['date_to'])]; + } + public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php index 91b7d532f..147735f32 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php @@ -20,6 +20,8 @@ use Symfony\Component\Form\FormBuilderInterface; class AdministrativeLocationFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} public function addRole(): ?string @@ -48,6 +50,21 @@ class AdministrativeLocationFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_locations' => $this->normalizeDoctrineEntity($formData['accepted_locations'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_locations' => $this->denormalizeDoctrineEntity($formData['accepted_locations'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php index ad8d66bf5..8345feaff 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php @@ -22,6 +22,8 @@ use Symfony\Component\Form\FormBuilderInterface; class ClosingMotiveFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} public function addRole(): ?string @@ -59,6 +61,21 @@ class ClosingMotiveFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_closingmotives' => $this->normalizeDoctrineEntity($formData['accepted_closingmotives'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_closingmotives' => $this->denormalizeDoctrineEntity($formData['accepted_closingmotives'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php index d7f608849..b296d4962 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php @@ -65,6 +65,21 @@ class ConfidentialFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_confidentials' => $formData['accepted_confidentials']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_confidentials' => $formData['accepted_confidentials']]; + } + public function getFormDefaultData(): array { return ['accepted_confidentials' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php index 5df66272b..0f362c2aa 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php @@ -21,6 +21,8 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function addRole(): ?string { return null; @@ -51,6 +53,21 @@ class CreatorFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_creators' => $this->normalizeDoctrineEntity($formData['accepted_creators'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_creators' => $this->denormalizeDoctrineEntity($formData['accepted_creators'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php index c1d178aea..3ffd5079a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php @@ -24,6 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorJobFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acp_filter_creator_job'; public function __construct( @@ -98,6 +99,21 @@ class CreatorJobFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['creator_job' => $this->normalizeDoctrineEntity($formData['creator_job'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['creator_job' => $this->denormalizeDoctrineEntity($formData['creator_job'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string'): array { $creatorJobs = []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php index cd1079a16..59529d731 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php @@ -65,6 +65,21 @@ class EmergencyFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_emergency' => $formData['accepted_emergency']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_emergency' => $formData['accepted_emergency']]; + } + public function getFormDefaultData(): array { return ['accepted_emergency' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php index b9fccfbef..4ee9ccd7d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php @@ -22,6 +22,8 @@ use Symfony\Component\Form\FormBuilderInterface; class EvaluationFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly EvaluationRepositoryInterface $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} public function addRole(): ?string @@ -65,6 +67,21 @@ class EvaluationFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_evaluations' => $this->normalizeDoctrineEntity($formData['accepted_evaluations'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_evaluations' => $this->denormalizeDoctrineEntity($formData['accepted_evaluations'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php index 093580c10..edaaef066 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php @@ -39,6 +39,21 @@ class HasNoActionFilter implements FilterInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php index 66538ab50..28ba5acac 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php @@ -62,6 +62,21 @@ class HasNoReferrerFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['calc_date' => $formData['calc_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['calc_date' => RollingDate::fromNormalized($formData['calc_date'])]; + } + public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php index 50bcc0f50..2645c1fb8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php @@ -73,6 +73,21 @@ class HasTemporaryLocationFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['having_temporarily' => $formData['having_temporarily'], 'calc_date' => $formData['calc_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['having_temporarily' => $formData['having_temporarily'], 'calc_date' => RollingDate::fromNormalized($formData['calc_date'])]; + } + public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php index ebe368468..3993495ca 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php @@ -42,6 +42,21 @@ final readonly class HavingAnAccompanyingPeriodInfoWithinDatesFilter implements ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])]; + } + public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_TODAY), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php index af2d61a38..6d065eb47 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php @@ -65,6 +65,21 @@ class IntensityFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_intensities' => $formData['accepted_intensities']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_intensities' => $formData['accepted_intensities']]; + } + public function getFormDefaultData(): array { return ['accepted_intensities' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php index 56210c4aa..8e38a2e0c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php @@ -33,6 +33,7 @@ use Symfony\Component\Form\FormBuilderInterface; */ readonly class JobWorkingOnCourseFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acp_filter_user_job_working_on_course'; public function __construct( @@ -105,6 +106,21 @@ readonly class JobWorkingOnCourseFilter implements FilterInterface ; } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['jobs' => $this->normalizeDoctrineEntity($formData['jobs']), 'start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + 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'])]; + } + public function describeAction($data, $format = 'string'): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilter.php index 75eca5873..dfdc5324f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilter.php @@ -40,6 +40,21 @@ final readonly class NotAssociatedWithAReferenceAddressFilter implements FilterI ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_calc' => $formData['date_calc']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_calc' => RollingDate::fromNormalized($formData['date_calc'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php index a0b94d9ab..b5a99ee82 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php @@ -53,6 +53,21 @@ class OpenBetweenDatesFilter implements FilterInterface ->add('date_to', PickRollingDateType::class, []); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_from' => $formData['date_from']->normalize(), 'date_to' => $formData['date_to']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_from' => RollingDate::fromNormalized($formData['date_from']), 'date_to' => RollingDate::fromNormalized($formData['date_to'])]; + } + public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_MONTH_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php index e74afb2a9..14d159445 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php @@ -22,6 +22,8 @@ use Symfony\Component\Form\FormBuilderInterface; class OriginFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} public function addRole(): ?string @@ -59,6 +61,21 @@ class OriginFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_origins' => $this->normalizeDoctrineEntity($formData['accepted_origins'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_origins' => $this->denormalizeDoctrineEntity($formData['accepted_origins'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php index eaa39d6b5..a35d13154 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php @@ -22,6 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ReferrerFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const A = 'acp_referrer_filter_uhistory'; private const P = 'acp_referrer_filter_date'; @@ -75,6 +76,21 @@ class ReferrerFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_referrers' => $this->normalizeDoctrineEntity($formData['accepted_referrers']), 'date_calc' => $formData['date_calc']->normalize()]; + } + + 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'])]; + } + public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY), 'accepted_referrers' => []]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDates.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDates.php index 8dab43de0..634a5e408 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDates.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDates.php @@ -32,6 +32,7 @@ use Symfony\Component\Form\FormBuilderInterface; */ final readonly class ReferrerFilterBetweenDates implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const A = 'acp_referrer_filter_uhistory'; private const P = 'acp_referrer_filter_date_start'; @@ -90,6 +91,21 @@ final readonly class ReferrerFilterBetweenDates implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_referrers' => $this->normalizeDoctrineEntity($formData['accepted_referrers']), 'start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + 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'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php index 7ce38cee0..c511b82f2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php @@ -117,6 +117,21 @@ final readonly class RequestorFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_choices' => $formData['accepted_choices']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_choices' => $formData['accepted_choices']]; + } + public function getFormDefaultData(): array { return ['accepted_choices' => self::DEFAULT_CHOICE]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php index a2a05c221..3a1814ff3 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php @@ -33,6 +33,7 @@ use Symfony\Component\Form\FormBuilderInterface; */ readonly class ScopeWorkingOnCourseFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acp_filter_user_scope_working_on_course'; public function __construct( @@ -100,6 +101,21 @@ readonly class ScopeWorkingOnCourseFilter implements FilterInterface ; } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['scopes' => $this->normalizeDoctrineEntity($formData['scopes']), 'start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + 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'])]; + } + public function describeAction($data, $format = 'string'): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php index 1123446c7..57947a68e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php @@ -112,6 +112,21 @@ final readonly class SocialActionFilter implements FilterInterface ; } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_socialactions' => $formData['accepted_socialactions'], 'start_date_after' => $formData['start_date_after']->normalize(), 'start_date_before' => $formData['start_date_before']->normalize(), 'end_date_after' => $formData['end_date_after']->normalize(), 'end_date_before' => $formData['end_date_before']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_socialactions' => $formData['accepted_socialactions'], 'start_date_after' => \Chill\MainBundle\Service\RollingDate\RollingDate::fromNormalized($formData['start_date_after']), 'start_date_before' => \Chill\MainBundle\Service\RollingDate\RollingDate::fromNormalized($formData['start_date_before']), 'end_date_after' => \Chill\MainBundle\Service\RollingDate\RollingDate::fromNormalized($formData['end_date_after']), 'end_date_before' => \Chill\MainBundle\Service\RollingDate\RollingDate::fromNormalized($formData['end_date_before'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php index bf4598236..7dffa4872 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php @@ -69,6 +69,21 @@ class SocialIssueFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_socialissues' => $formData['accepted_socialissues']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_socialissues' => $formData['accepted_socialissues']]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php index 273d9e333..4c32d646c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php @@ -88,6 +88,21 @@ class StepFilterBetweenDates implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_steps_multi' => $formData['accepted_steps_multi'], 'date_from' => $formData['date_from']->normalize(), 'date_to' => $formData['date_to']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_steps_multi' => $formData['accepted_steps_multi'], 'date_from' => RollingDate::fromNormalized($formData['date_from']), 'date_to' => RollingDate::fromNormalized($formData['date_to'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php index 8b5448497..9428c3642 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php @@ -43,7 +43,7 @@ final readonly class UserJobFilter implements FilterInterface, DataTransformerIn return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $p = self::PREFIX; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php index 3489b8cb3..da3b965cf 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php @@ -29,6 +29,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class UserScopeFilter implements FilterInterface, DataTransformerInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acp_filter_main_scope'; public function __construct( @@ -42,7 +43,7 @@ final readonly class UserScopeFilter implements FilterInterface, DataTransformer return null; } - public function alterQuery(QueryBuilder $qb, $data): void + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void { $p = self::PREFIX; @@ -96,6 +97,21 @@ final readonly class UserScopeFilter implements FilterInterface, DataTransformer ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['scopes' => $this->normalizeDoctrineEntity($formData['scopes']), 'start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + 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'])]; + } + public function describeAction($data, $format = 'string') { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php index 85d5db9d6..e383e7737 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php @@ -31,6 +31,8 @@ use Symfony\Component\Form\FormBuilderInterface; */ final readonly class UserWorkingOnCourseFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct( private UserRender $userRender, private RollingDateConverterInterface $rollingDateConverter, @@ -51,6 +53,21 @@ final readonly class UserWorkingOnCourseFilter implements FilterInterface ; } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['users' => $this->normalizeDoctrineEntity($formData['users']), 'start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + 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'])]; + } + public function getFormDefaultData(): array { return [ @@ -87,7 +104,7 @@ final readonly class UserWorkingOnCourseFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data): void + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void { $ai_alias = 'user_working_on_course_filter_acc_info'; $ai_users = 'user_working_on_course_filter_users'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilter.php index 84a5814b3..244036ffc 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilter.php @@ -51,6 +51,21 @@ final readonly class ByDateFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])]; + } + public function getFormDefaultData(): array { return [ @@ -75,7 +90,7 @@ final readonly class ByDateFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $startDate = 'acp_step_history_by_date_start_filter'; $endDate = 'acp_step_history_by_date_end_filter'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilter.php index 337c30a89..f65e0dae4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilter.php @@ -50,6 +50,21 @@ final readonly class ByStepFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['steps' => $formData['steps']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['steps' => $formData['steps']]; + } + public function getFormDefaultData(): array { return [ @@ -72,7 +87,7 @@ final readonly class ByStepFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $qb ->andWhere('acpstephistory.step IN (:acpstephistory_by_step_filter_steps)') diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php index a0d8d0033..ac5c2e0c9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php @@ -28,7 +28,7 @@ class ByEndDateFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data): void + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void { $qb ->andWhere('workeval.endDate BETWEEN :work_eval_by_end_date_start_date and :work_eval_by_end_date_end_date') @@ -58,6 +58,21 @@ class ByEndDateFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])]; + } + public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php index 401cd79a5..6cd3bfc45 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php @@ -28,7 +28,7 @@ class ByStartDateFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data): void + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void { $qb ->andWhere('workeval.startDate BETWEEN :work_eval_by_start_date_start_date and :work_eval_by_start_date_end_date') @@ -58,6 +58,21 @@ class ByStartDateFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])]; + } + public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php index 360b47f2d..63a4366b2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php @@ -23,7 +23,7 @@ class CurrentEvaluationsFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data): void + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void { $qb->andWhere('workeval.endDate IS NULL'); } @@ -38,6 +38,21 @@ class CurrentEvaluationsFilter implements FilterInterface // no form needed } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php index 20472420c..5db19bdc0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php @@ -22,6 +22,8 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class EvaluationTypeFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private TranslatableStringHelper $translatableStringHelper, private EvaluationRepositoryInterface $evaluationRepository) {} public function addRole(): ?string @@ -29,7 +31,7 @@ final readonly class EvaluationTypeFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $qb->andWhere( $qb->expr()->in('workeval.evaluation', ':evaluationtype') @@ -58,6 +60,21 @@ final readonly class EvaluationTypeFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_evaluationtype' => $this->normalizeDoctrineEntity($formData['accepted_evaluationtype'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_evaluationtype' => $this->denormalizeDoctrineEntity($formData['accepted_evaluationtype'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php index 6094d56ee..ead1a5b66 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php @@ -32,7 +32,7 @@ class MaxDateFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { if (true === $data['maxdate']) { $clause = $qb->expr()->isNotNull('workeval.maxDate'); @@ -57,6 +57,21 @@ class MaxDateFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['maxdate' => $formData['maxdate']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['maxdate' => $formData['maxdate']]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php index b9f9075ed..01cba5b85 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php @@ -25,6 +25,8 @@ use Symfony\Component\Form\FormBuilderInterface; readonly class CompositionFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct( private TranslatableStringHelper $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter, @@ -35,7 +37,7 @@ readonly class CompositionFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data): void + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void { // there is no test on the aliases here: the name should be unique $clause = @@ -78,6 +80,21 @@ readonly class CompositionFilter implements FilterInterface ->add('on_date', PickRollingDateType::class, []); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_composition' => $this->normalizeDoctrineEntity($formData['accepted_composition']), 'on_date' => $formData['on_date']->normalize()]; + } + + 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'])]; + } + public function getFormDefaultData(): array { return ['on_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php index 8cd675abe..d0c63fb69 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php @@ -30,7 +30,7 @@ class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $subQuery = 'SELECT 1 @@ -78,6 +78,21 @@ class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_calc' => $formData['date_calc']->normalize(), 'ref_statuses' => $formData['ref_statuses']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_calc' => RollingDate::fromNormalized($formData['date_calc']), 'ref_statuses' => $formData['ref_statuses']]; + } + public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY), 'ref_statuses' => [Address::ADDR_REFERENCE_STATUS_TO_REVIEW]]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php index aa97ad54c..4632c6bd4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php @@ -32,7 +32,7 @@ class AgeFilter implements ExportElementValidatedInterface, FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $where = $qb->getDQLPart('where'); @@ -86,6 +86,21 @@ class AgeFilter implements ExportElementValidatedInterface, FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['min_age' => $formData['min_age'], 'max_age' => $formData['max_age'], 'date_calc' => $formData['date_calc']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['min_age' => $formData['min_age'], 'max_age' => $formData['max_age'], 'date_calc' => RollingDate::fromNormalized($formData['date_calc'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php index dd14c71ef..c307439db 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php @@ -31,7 +31,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $where = $qb->getDQLPart('where'); $clause = $qb->expr()->between( @@ -73,6 +73,21 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_from' => $formData['date_from']->normalize(), 'date_to' => $formData['date_to']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_from' => RollingDate::fromNormalized($formData['date_from']), 'date_to' => RollingDate::fromNormalized($formData['date_to'])]; + } + public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php index e873a6598..6a5cdb5a8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php @@ -29,6 +29,8 @@ use Symfony\Component\Form\FormBuilderInterface; class ByHouseholdCompositionFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} public function addRole(): ?string @@ -36,7 +38,7 @@ class ByHouseholdCompositionFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $p = 'person_by_household_compo_filter'; @@ -76,6 +78,21 @@ class ByHouseholdCompositionFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['compositions' => $this->normalizeDoctrineEntity($formData['compositions']), 'calc_date' => $formData['calc_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['compositions' => $this->denormalizeDoctrineEntity($formData['compositions'], $this->someRepository), 'calc_date' => RollingDate::fromNormalized($formData['calc_date'])]; + } + public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php index 82cda25ed..2fb488a98 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php @@ -30,7 +30,7 @@ class DeadOrAliveFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $where = $qb->getDQLPart('where'); @@ -99,6 +99,21 @@ class DeadOrAliveFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['person_state' => $formData['person_state'], 'date_calc' => $formData['date_calc']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['person_state' => $formData['person_state'], 'date_calc' => RollingDate::fromNormalized($formData['date_calc'])]; + } + public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php index 1bc32d9bb..0fb9956b7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php @@ -31,7 +31,7 @@ class DeathdateFilter implements ExportElementValidatedInterface, FilterInterfac return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $where = $qb->getDQLPart('where'); $clause = $qb->expr()->between( @@ -73,6 +73,21 @@ class DeathdateFilter implements ExportElementValidatedInterface, FilterInterfac ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_from' => $formData['date_from']->normalize(), 'date_to' => $formData['date_to']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_from' => RollingDate::fromNormalized($formData['date_from']), 'date_to' => RollingDate::fromNormalized($formData['date_to'])]; + } + public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php index fc09e385a..b80db6172 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php @@ -41,7 +41,7 @@ class GenderFilter implements return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $where = $qb->getDQLPart('where'); $isIn = $qb->expr()->in('person.gender', ':person_gender'); @@ -81,6 +81,21 @@ class GenderFilter implements ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_genders_entity' => $formData['accepted_genders_entity']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['accepted_genders_entity' => $formData['accepted_genders_entity']]; + } + public function transformData(?array $before): array { $transformedData = []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php index 6c4cdf802..c77a16373 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php @@ -19,6 +19,8 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType; class MaritalStatusFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} public function addRole(): ?string @@ -26,7 +28,7 @@ class MaritalStatusFilter implements FilterInterface return null; } - public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data) + public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $qb->andWhere( $qb->expr()->in('person.maritalStatus', ':maritalStatus') @@ -51,6 +53,21 @@ class MaritalStatusFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['maritalStatus' => $this->normalizeDoctrineEntity($formData['maritalStatus'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['maritalStatus' => $this->denormalizeDoctrineEntity($formData['maritalStatus'], $this->someRepository)]; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php index 4c83fafe3..e6ac02c8b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php @@ -33,7 +33,7 @@ class NationalityFilter implements return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $where = $qb->getDQLPart('where'); $clause = $qb->expr()->in('person.nationality', ':person_nationality'); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php index ea8e01baf..8ae1dc4a2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php @@ -26,6 +26,8 @@ use Symfony\Component\Form\FormBuilderInterface; class ResidentialAddressAtThirdpartyFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringHelper $translatableStringHelper) {} public function addRole(): ?string @@ -33,7 +35,7 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { if (!\in_array('resaddr', $qb->getAllAliases(), true)) { $qb->join(ResidentialAddress::class, 'resaddr', Expr\Join::WITH, 'resaddr.person = person'); @@ -99,6 +101,21 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['thirdparty_cat' => $this->normalizeDoctrineEntity($formData['thirdparty_cat']), 'date_calc' => $formData['date_calc']->normalize()]; + } + + 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'])]; + } + public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php index 3c2d7a3a6..960d440d2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php @@ -30,7 +30,7 @@ class ResidentialAddressAtUserFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { if (!\in_array('resaddr', $qb->getAllAliases(), true)) { $qb->join(ResidentialAddress::class, 'resaddr', Expr\Join::WITH, 'resaddr.person = person'); @@ -78,6 +78,21 @@ class ResidentialAddressAtUserFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_calc' => $formData['date_calc']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_calc' => RollingDate::fromNormalized($formData['date_calc'])]; + } + public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilter.php index 289af5f07..a09c3e9e7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilter.php @@ -32,7 +32,7 @@ final readonly class WithParticipationBetweenDatesFilter implements FilterInterf return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $p = 'with_participation_between_dates_filter'; @@ -65,6 +65,21 @@ final readonly class WithParticipationBetweenDatesFilter implements FilterInterf ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_after' => $formData['date_after']->normalize(), 'date_before' => $formData['date_before']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_after' => RollingDate::fromNormalized($formData['date_after']), 'date_before' => RollingDate::fromNormalized($formData['date_before'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php index c34c7eb40..10fc5016f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php @@ -31,7 +31,7 @@ class WithoutHouseholdComposition implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $p = 'person_by_household_no_compo_filter'; @@ -63,6 +63,21 @@ class WithoutHouseholdComposition implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['calc_date' => $formData['calc_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['calc_date' => RollingDate::fromNormalized($formData['calc_date'])]; + } + public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutParticipationBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutParticipationBetweenDatesFilter.php index d1e3e9b2f..be6473cbc 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutParticipationBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutParticipationBetweenDatesFilter.php @@ -32,7 +32,7 @@ final readonly class WithoutParticipationBetweenDatesFilter implements FilterInt return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $p = 'without_participation_between_dates_filter'; @@ -67,6 +67,21 @@ final readonly class WithoutParticipationBetweenDatesFilter implements FilterInt ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_after' => $formData['date_after']->normalize(), 'date_before' => $formData['date_before']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_after' => RollingDate::fromNormalized($formData['date_after']), 'date_before' => RollingDate::fromNormalized($formData['date_before'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php index 05d4633e2..04d2cef5f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php @@ -41,6 +41,21 @@ final readonly class AccompanyingPeriodWorkEndDateBetweenDateFilter implements F ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize(), 'keep_null' => $formData['keep_null']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date']), 'keep_null' => $formData['keep_null']]; + } + public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_TODAY), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; @@ -67,7 +82,7 @@ final readonly class AccompanyingPeriodWorkEndDateBetweenDateFilter implements F return null; } - public function alterQuery(QueryBuilder $qb, $data): void + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void { $as = 'acc_pe_work_end_between_filter_start'; $ae = 'acc_pe_work_end_between_filter_end'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php index 880543355..e5b1e17b0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php @@ -41,6 +41,21 @@ final readonly class AccompanyingPeriodWorkStartDateBetweenDateFilter implements ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize(), 'keep_null' => $formData['keep_null']]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date']), 'keep_null' => $formData['keep_null']]; + } + public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_TODAY), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; @@ -67,7 +82,7 @@ final readonly class AccompanyingPeriodWorkStartDateBetweenDateFilter implements return null; } - public function alterQuery(QueryBuilder $qb, $data): void + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void { $as = 'acc_pe_work_start_between_filter_start'; $ae = 'acc_pe_work_start_between_filter_end'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter.php index e0c4da1e9..cb7e27ab0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter.php @@ -37,6 +37,21 @@ final readonly class AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter impl ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['start_date' => $formData['start_date']->normalize(), 'end_date' => $formData['end_date']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['start_date' => RollingDate::fromNormalized($formData['start_date']), 'end_date' => RollingDate::fromNormalized($formData['end_date'])]; + } + public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_YEAR_CURRENT_START), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; @@ -63,7 +78,7 @@ final readonly class AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter impl return null; } - public function alterQuery(QueryBuilder $qb, $data): void + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void { $s = 'workeval_between_filter_start'; $e = 'workeval_between_filter_end'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php index c990e658e..3a174e492 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php @@ -21,6 +21,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acpw_filter_creator'; public function addRole(): ?string @@ -28,7 +29,7 @@ class CreatorFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $p = self::PREFIX; @@ -52,6 +53,21 @@ class CreatorFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['creators' => $this->normalizeDoctrineEntity($formData['creators'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['creators' => $this->denormalizeDoctrineEntity($formData['creators'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string'): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php index 3087d156e..f4e4018bc 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php @@ -24,6 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorJobFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acpw_filter_creator_job'; public function __construct( @@ -36,7 +37,7 @@ class CreatorJobFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $p = self::PREFIX; @@ -78,6 +79,21 @@ class CreatorJobFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['jobs' => $this->normalizeDoctrineEntity($formData['jobs'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['jobs' => $this->denormalizeDoctrineEntity($formData['jobs'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string'): array { $creatorJobs = []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php index 414740c7a..afd3d43f7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php @@ -24,6 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorScopeFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acpw_filter_creator_scope'; public function __construct( @@ -36,7 +37,7 @@ class CreatorScopeFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $p = self::PREFIX; @@ -78,6 +79,21 @@ class CreatorScopeFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['scopes' => $this->normalizeDoctrineEntity($formData['scopes'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['scopes' => $this->denormalizeDoctrineEntity($formData['scopes'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string'): array { $creatorScopes = []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php index b11d2a93c..1b764eb3a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php @@ -23,7 +23,7 @@ class CurrentActionFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data): void + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void { $qb->andWhere('acpw.endDate IS NULL'); } @@ -38,6 +38,21 @@ class CurrentActionFilter implements FilterInterface // no form } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php index 25e762a9c..890ed6a9b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php @@ -25,6 +25,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class JobFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acp_work_action_filter_user_job'; public function __construct( @@ -38,7 +39,7 @@ class JobFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $p = self::PREFIX; @@ -72,6 +73,21 @@ class JobFilter implements FilterInterface ; } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['job' => $this->normalizeDoctrineEntity($formData['job'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['job' => $this->denormalizeDoctrineEntity($formData['job'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string') { $userjobs = []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php index 4d456fdb2..00047f52d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php @@ -22,6 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ReferrerFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acpw_referrer_filter'; public function __construct(private RollingDateConverterInterface $rollingDateConverter) {} @@ -31,7 +32,7 @@ final readonly class ReferrerFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $p = self::PREFIX; @@ -67,6 +68,21 @@ final readonly class ReferrerFilter implements FilterInterface ; } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['accepted_agents' => $this->normalizeDoctrineEntity($formData['accepted_agents']), 'agent_at' => $formData['agent_at']->normalize()]; + } + + 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'])]; + } + public function getFormDefaultData(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php index 9f2041aaa..33a9033c9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php @@ -25,6 +25,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ScopeFilter implements FilterInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; private const PREFIX = 'acp_work_action_filter_user_scope'; public function __construct( @@ -38,7 +39,7 @@ class ScopeFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $p = self::PREFIX; @@ -71,6 +72,21 @@ class ScopeFilter implements FilterInterface ; } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['scope' => $this->normalizeDoctrineEntity($formData['scope'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['scope' => $this->denormalizeDoctrineEntity($formData['scope'], $this->someRepository)]; + } + public function describeAction($data, $format = 'string'): array { $scopes = []; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php index c84ed7f40..93d5e0097 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php @@ -33,7 +33,7 @@ class SocialWorkTypeFilter implements FilterInterface return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { if (\count($data['actionType']) > 0) { $qb @@ -95,6 +95,21 @@ class SocialWorkTypeFilter implements FilterInterface ); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return []; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return []; + } + public function getFormDefaultData(): array { return ['action_type' => [], 'goal' => [], 'result' => []]; diff --git a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php index 1761e3522..be246c76d 100644 --- a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php +++ b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php @@ -35,6 +35,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ReportList implements ExportElementValidatedInterface, ListInterface { + use \Chill\MainBundle\Export\ExportDataNormalizerTrait; protected array $fields = [ 'person_id', 'person_firstName', 'person_lastName', 'person_birthdate', 'person_placeOfBirth', 'person_gender', 'person_memo', 'person_email', 'person_phonenumber', @@ -97,6 +98,21 @@ class ReportList implements ExportElementValidatedInterface, ListInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['fields' => $formData['fields'], 'address_date' => $this->normalizeDate($formData['address_date'])]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['fields' => $formData['fields'], 'address_date' => $this->denormalizeDate($formData['address_date'])]; + } + public function getFormDefaultData(): array { return ['address_date' => new \DateTime()]; @@ -267,7 +283,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface return [...$fields, ...\array_keys($this->slugs)]; } - public function getResult($query, $data) + public function getResult($query, $data, \Chill\MainBundle\Export\ExportGenerationContext $context) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } diff --git a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php index 0346f2ab3..294a8d5e9 100644 --- a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php +++ b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php @@ -26,7 +26,7 @@ class ReportDateFilter implements FilterInterface return null; } - public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data) + public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) { $where = $qb->getDQLPart('where'); $clause = $qb->expr()->between( @@ -68,6 +68,21 @@ class ReportDateFilter implements FilterInterface ]); } + public function getNormalizationVersion(): int + { + return 1; + } + + public function normalizeFormData(array $formData): array + { + return ['date_from' => $formData['date_from']->normalize(), 'date_to' => $formData['date_to']->normalize()]; + } + + public function denormalizeFormData(array $formData, int $fromVersion): array + { + return ['date_from' => RollingDate::fromNormalized($formData['date_from']), 'date_to' => RollingDate::fromNormalized($formData['date_to'])]; + } + public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)];