diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php index 365433ef3..eba8fc7bc 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\MainBundle\Serializer\Normalizer; use Chill\MainBundle\Entity\Center; +use Chill\MainBundle\Entity\Civility; use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\User; @@ -60,9 +61,14 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware $context, ['docgen:expects' => Location::class, 'groups' => 'docgen:read'] ); + $civilityContext = array_merge( + $context, + ['docgen:expects' => Civility::class, 'groups' => 'docgen:read'] + ); if (null === $user && 'docgen' === $format) { return array_merge(self::NULL_USER, [ + 'civility' => $this->normalizer->normalize(null, $format, $civilityContext), 'user_job' => $this->normalizer->normalize(null, $format, $userJobContext), 'main_center' => $this->normalizer->normalize(null, $format, $centerContext), 'main_scope' => $this->normalizer->normalize(null, $format, $scopeContext), @@ -84,6 +90,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware ]; if ('docgen' === $format) { + $data['civility'] = $this->normalizer->normalize($user->getCivility(), $format, $civilityContext); $data['current_location'] = $this->normalizer->normalize($user->getCurrentLocation(), $format, $locationContext); $data['main_location'] = $this->normalizer->normalize($user->getMainLocation(), $format, $locationContext); }