doc generation: add age and obele in the mainPerson, person1 and person2 list + add obele in person renderString if addAge

This commit is contained in:
nobohan 2022-02-11 14:24:12 +01:00
parent 4dd9bc1123
commit 692343aae4
2 changed files with 8 additions and 1 deletions

View File

@ -161,7 +161,7 @@ class AccompanyingPeriodContext implements
'class' => Person::class,
'choices' => $persons,
'choice_label' => function (Person $p) {
return $this->personRender->renderString($p, []);
return $this->personRender->renderString($p, ['addAge' => true]);
},
'multiple' => false,
'expanded' => true,

View File

@ -83,6 +83,13 @@ class PersonRender extends AbstractChillEntityRender
. $this->addAltNames($person, false) . ' (' . $this->translator->trans('years_old', ['age' => $person->getAge()]) . ')';
}
if (null !== $person->getDeathDate() && $options['addAge']) {
return $person->getFirstName() . ' ' . $person->getLastName()
. ' (‡)'
. $this->addAltNames($person, false);
}
return $person->getFirstName() . ' ' . $person->getLastName()
. $this->addAltNames($person, false);
}