From 97ec921a0a01a9f81b730c139cd2628e4c551e4e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 9 Aug 2022 16:15:27 +0200 Subject: [PATCH] small adjustments --- src/Bundle/ChillPersonBundle/Entity/MaritalStatus.php | 2 +- .../PersonAggregators/ProfessionalSitutaionAggregator.php | 8 ++++++-- .../Export/Filter/PersonFilters/EntrustedChildFilter.php | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/MaritalStatus.php b/src/Bundle/ChillPersonBundle/Entity/MaritalStatus.php index 56c9368dc..649830b4a 100644 --- a/src/Bundle/ChillPersonBundle/Entity/MaritalStatus.php +++ b/src/Bundle/ChillPersonBundle/Entity/MaritalStatus.php @@ -31,7 +31,7 @@ class MaritalStatus private ?string $id; /** - * @var string array + * @var array * @ORM\Column(type="json") */ private array $name; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ProfessionalSitutaionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ProfessionalSitutaionAggregator.php index 0ee31d4fe..476c7ea0a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ProfessionalSitutaionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ProfessionalSitutaionAggregator.php @@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Export\Aggregator\PersonAggregators; use App\Repository\VendeePerson\SituationProfessionelleRepository; use Chill\MainBundle\Export\AggregatorInterface; +use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; @@ -22,10 +23,13 @@ use Symfony\Component\Form\FormBuilderInterface; final class ProfessionalSituationAggregator implements AggregatorInterface { private SituationProfessionelleRepository $professionalSituationRepository; + + private TranslatableStringHelper $translatableStringHelper; - public function __construct(SituationProfessionelleRepository $professionalSituationRepository) + public function __construct(SituationProfessionelleRepository $professionalSituationRepository, TranslatableStringHelper $translatableStringHelper) { $this->professionalSituationRepository = $professionalSituationRepository; + $this->translatableStringHelper = $translatableStringHelper; } public function addRole() @@ -70,7 +74,7 @@ final class ProfessionalSituationAggregator implements AggregatorInterface $g = $this->professionalSituationRepository->find($value); - return $g->getName()['fr']; + return $this->translatableStringHelper->localize($g->getName());; }; } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/EntrustedChildFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/EntrustedChildFilter.php index ce09901b7..0e85232bf 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/EntrustedChildFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/EntrustedChildFilter.php @@ -15,6 +15,7 @@ use Chill\MainBundle\Export\FilterInterface; use Chill\PersonBundle\Export\Declarations; use DateTime; use Doctrine\ORM\Query\Expr\Andx; +use Symfony\Component\Form\FormBuilderInterface; class EntrustedChildFilter implements FilterInterface { @@ -48,7 +49,7 @@ class EntrustedChildFilter implements FilterInterface return Declarations::PERSON_TYPE; } - public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) + public function buildForm(FormBuilderInterface $builder) { // No form needed }