From 31745bc25213a834bc2e5a5ecf04307494694bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 29 Jun 2023 17:52:26 +0200 Subject: [PATCH] [export] order center alphabetically when generating an export --- src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php index d33ab2ade..c51676b32 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php @@ -57,6 +57,9 @@ final class PickCenterType extends AbstractType $export->requiredRole() ); + // order alphabetically + usort($centers, fn (Center $a, Center $b) => $a->getCenter() <=> $b->getName()); + $builder->add('center', EntityType::class, [ 'class' => Center::class, 'choices' => $centers,