mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge branch 'master' into notification/completion
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Serializer\Normalizer;
|
||||
|
||||
use Chill\DocGeneratorBundle\Serializer\Helper\NormalizeNullValueHelper;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Entity\Location;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
|
||||
@@ -68,6 +69,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
|
||||
'resources' => Collection::class,
|
||||
'location' => Address::class,
|
||||
'locationPerson' => Person::class,
|
||||
'administrativeLocation' => Location::class,
|
||||
];
|
||||
|
||||
private ClosingMotiveRender $closingMotiveRender;
|
||||
@@ -111,6 +113,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
|
||||
$dateContext = array_merge($context, ['docgen:expects' => DateTime::class, 'groups' => 'docgen:read']);
|
||||
$userContext = array_merge($context, ['docgen:expects' => User::class, 'groups' => 'docgen:read']);
|
||||
$participationContext = array_merge($context, ['docgen:expects' => AccompanyingPeriodParticipation::class, 'groups' => 'docgen:read']);
|
||||
$administrativeLocationContext = array_merge($context, ['docgen:expects' => Location::class, 'groups' => 'docgen:read']);
|
||||
|
||||
return [
|
||||
'id' => $period->getId(),
|
||||
@@ -153,8 +156,10 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
|
||||
'requestorKind' => $period->getRequestorKind(),
|
||||
'hasLocation' => $period->getLocation() !== null,
|
||||
'hasLocationPerson' => $period->getPersonLocation() !== null,
|
||||
'hasAdministrativeLocation' => $period->getAdministrativeLocation() !== null,
|
||||
'locationPerson' => $this->normalizer->normalize($period->getPersonLocation(), $format, array_merge($context, ['docgen:expects' => Person::class])),
|
||||
'location' => $this->normalizer->normalize($period->getLocation(), $format, $addressContext),
|
||||
'administrativeLocation' => $this->normalizer->normalize($period->getAdministrativeLocation(), $format, $administrativeLocationContext),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -172,6 +177,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
|
||||
'confidential' => false,
|
||||
'hasLocation' => false,
|
||||
'hasLocationPerson' => false,
|
||||
'hasAdministrativeLocation' => false,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@@ -151,7 +151,7 @@ class PersonDocGenNormalizer implements
|
||||
$normalizer = new NormalizeNullValueHelper($this->normalizer, 'type', 'person');
|
||||
|
||||
$attributes = [
|
||||
'firstname', 'lastname', 'altNames', 'text',
|
||||
'firstname', 'lastname', 'age', 'altNames', 'text',
|
||||
'civility' => Civility::class,
|
||||
'birthdate' => DateTimeInterface::class,
|
||||
'deathdate' => DateTimeInterface::class,
|
||||
|
Reference in New Issue
Block a user