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
@ -66,7 +66,7 @@ class TranslatableActivityReason extends AbstractType
|
||||
{
|
||||
return EntityType::class;
|
||||
}
|
||||
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(
|
||||
@ -75,8 +75,12 @@ class TranslatableActivityReason extends AbstractType
|
||||
'choice_label' => function(ActivityReason $choice) {
|
||||
return $this->reasonRender->renderString($choice, []);
|
||||
},
|
||||
'group_by' => function(ActivityReason $choice) {
|
||||
return $this->translatableStringHelper->localize($choice->getCategory()->getName());
|
||||
'group_by' => function(ActivityReason $choice): ?string {
|
||||
if (null !== $category = $choice->getCategory()) {
|
||||
return $this->translatableStringHelper->localize($category->getName());
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
'query_builder' => function (EntityRepository $er) {
|
||||
return $er->createQueryBuilder('r')
|
||||
|
Loading…
x
Reference in New Issue
Block a user