From b1ae55ba809fb40404de3f05ecc2f212561f8bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 5 Sep 2018 15:14:07 +0200 Subject: [PATCH] [user list] order users by username --- Controller/UserController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Controller/UserController.php b/Controller/UserController.php index 858db9d07..7b2b013e6 100644 --- a/Controller/UserController.php +++ b/Controller/UserController.php @@ -30,7 +30,9 @@ class UserController extends Controller { $em = $this->getDoctrine()->getManager(); - $entities = $em->getRepository('ChillMainBundle:User')->findAll(); + $entities = $em->createQuery('SELECT u FROM ChillMainBundle:User u ' + . 'ORDER BY u.username') + ->getResult(); return $this->render('ChillMainBundle:User:index.html.twig', array( 'entities' => $entities,