Category: entity

How can I sort group_by option for entityType field in formbuilder?

I am grouping my $entity output with frombuilder: $options[‘group_by’] = function ($entity) { if ($entity->getCategory() != null) { return $entity->getCategory()->getName(); } else { return "all"; } }; This is the output of my dropdown: colors blue red green all colors…