Take null value for gender into account and user Interface for translatableStringHelper

This commit is contained in:
2024-11-26 15:37:05 +01:00
parent 0b22250dd5
commit f4f5153ed0
2 changed files with 3 additions and 3 deletions

View File

@@ -95,7 +95,7 @@ class PersonDocGenNormalizer implements
'age' => (int) $person->getAge(),
'birthdate' => $this->normalizer->normalize($person->getBirthdate(), $format, $dateContext),
'deathdate' => $this->normalizer->normalize($person->getDeathdate(), $format, $dateContext),
'gender' => $this->translatableStringHelper->localize($person->getGender()->getLabel()),
'gender' => null !== ($g = $person->getGender()) ? $this->translatableStringHelper->localize($g->getLabel()) : '',
'genderEntity' => $this->normalizer->normalize($person->getGender(), $format, $genderContext),
'maritalStatus' => null !== ($ms = $person->getMaritalStatus()) ? $this->translatableStringHelper->localize($ms->getName()) : '',
'maritalStatusDate' => $this->normalizer->normalize($person->getMaritalStatusDate(), $format, $dateContext),