mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-07 07:14:58 +00:00
use translatablestringhelper
This commit is contained in:
@@ -12,21 +12,23 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Export\Aggregator\PersonAggregators;
|
||||
|
||||
use Chill\MainBundle\Export\AggregatorInterface;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Chill\PersonBundle\Repository\MaritalStatusRepository;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use LogicException;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
|
||||
final class MaritalStatusAggregator implements AggregatorInterface
|
||||
{
|
||||
private MaritalStatusRepository $maritalStatusRepository;
|
||||
|
||||
public function __construct(MaritalStatusRepository $maritalStatusRepository)
|
||||
private TranslatableStringHelper $translatableStringHelper;
|
||||
|
||||
public function __construct(MaritalStatusRepository $maritalStatusRepository, TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
$this->maritalStatusRepository = $maritalStatusRepository;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
public function addRole()
|
||||
@@ -66,7 +68,7 @@ final class MaritalStatusAggregator implements AggregatorInterface
|
||||
|
||||
$g = $this->maritalStatusRepository->find($value);
|
||||
|
||||
return $g->getName()['fr'];
|
||||
return $this->translatableStringHelper->localize($g->getName());
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user