mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
when reasons are not in a category
This commit is contained in:
parent
ef5296c33f
commit
cd054fe6ef
@ -75,8 +75,12 @@ class TranslatableActivityReason extends AbstractType
|
|||||||
'choice_label' => function(ActivityReason $choice) {
|
'choice_label' => function(ActivityReason $choice) {
|
||||||
return $this->reasonRender->renderString($choice, []);
|
return $this->reasonRender->renderString($choice, []);
|
||||||
},
|
},
|
||||||
'group_by' => function(ActivityReason $choice) {
|
'group_by' => function(ActivityReason $choice): ?string {
|
||||||
return $this->translatableStringHelper->localize($choice->getCategory()->getName());
|
if (null !== $category = $choice->getCategory()) {
|
||||||
|
return $this->translatableStringHelper->localize($category->getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
},
|
},
|
||||||
'query_builder' => function (EntityRepository $er) {
|
'query_builder' => function (EntityRepository $er) {
|
||||||
return $er->createQueryBuilder('r')
|
return $er->createQueryBuilder('r')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user