Improve naming for 'at date' in user render component

This commit is contained in:
2024-01-08 11:25:13 +01:00
parent 4091efc72e
commit d0ec6f9819
3 changed files with 17 additions and 17 deletions

View File

@@ -24,7 +24,7 @@ class UserRender implements ChillEntityRenderInterface
'main_scope' => true,
'user_job' => true,
'absence' => true,
'at' => null,
'at_date' => null,
];
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator)
@@ -47,14 +47,14 @@ class UserRender implements ChillEntityRenderInterface
$str = $entity->getLabel();
if (null !== $entity->getUserJob($opts['at']) && $opts['user_job']) {
if (null !== $entity->getUserJob($opts['at_date']) && $opts['user_job']) {
$str .= ' ('.$this->translatableStringHelper
->localize($entity->getUserJob($opts['at'])->getLabel()).')';
->localize($entity->getUserJob($opts['at_date'])->getLabel()).')';
}
if (null !== $entity->getMainScope($opts['at']) && $opts['main_scope']) {
if (null !== $entity->getMainScope($opts['at_date']) && $opts['main_scope']) {
$str .= ' ('.$this->translatableStringHelper
->localize($entity->getMainScope($opts['at'])->getName()).')';
->localize($entity->getMainScope($opts['at_date'])->getName()).')';
}
if ($entity->isAbsent() && $opts['absence']) {