add age in some place and re-organize some usage of the component

This commit is contained in:
2022-01-31 12:45:50 +01:00
parent 186b8847d9
commit e04c02055c
13 changed files with 39 additions and 35 deletions

View File

@@ -179,7 +179,8 @@ class PersonJsonNormalizer implements
return [
'type' => 'person',
'id' => $person->getId(),
'text' => $this->render->renderString($person),
'text' => $this->render->renderString($person, ['addAge' => false]),
'textAge' => $this->render->renderString($person, ['addAge' => true]),
'firstName' => $person->getFirstName(),
'lastName' => $person->getLastName(),
'birthdate' => $this->normalizer->normalize($person->getBirthdate(), $format, $context),