mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix circular reference in center normalization
This commit is contained in:
parent
fe3d4e1f0a
commit
b43a3d394b
@ -20,6 +20,7 @@ namespace Chill\PersonBundle\Serializer\Normalizer;
|
||||
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface;
|
||||
use Chill\PersonBundle\Entity\Household\Household;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
|
||||
@ -49,7 +50,7 @@ class PersonJsonNormalizer implements
|
||||
|
||||
private PersonRepository $repository;
|
||||
|
||||
private CenterResolverDispatcher $centerResolverDispatcher;
|
||||
private CenterResolverManagerInterface $centerResolverDispatcher;
|
||||
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
@ -60,7 +61,7 @@ class PersonJsonNormalizer implements
|
||||
public function __construct(
|
||||
ChillEntityRenderExtension $render,
|
||||
PersonRepository $repository,
|
||||
CenterResolverDispatcher $centerResolverDispatcher
|
||||
CenterResolverManagerInterface $centerResolverDispatcher
|
||||
) {
|
||||
$this->render = $render;
|
||||
$this->repository = $repository;
|
||||
@ -81,7 +82,7 @@ class PersonJsonNormalizer implements
|
||||
'lastName' => $person->getLastName(),
|
||||
'birthdate' => $this->normalizer->normalize($person->getBirthdate()),
|
||||
'deathdate' => $this->normalizer->normalize($person->getDeathdate()),
|
||||
'center' => $this->normalizer->normalize($this->centerResolverDispatcher->resolveCenter($person)),
|
||||
'center' => $this->normalizer->normalize($this->centerResolverDispatcher->resolveCenters($person), $format, $context),
|
||||
'phonenumber' => $person->getPhonenumber(),
|
||||
'mobilenumber' => $person->getMobilenumber(),
|
||||
'altNames' => $this->normalizeAltNames($person->getAltNames()),
|
||||
|
Loading…
x
Reference in New Issue
Block a user