From 17fa1baeddd0af4b0200a4949e36e5d9bc7ab357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 25 Nov 2014 22:44:49 +0100 Subject: [PATCH] add "order by" clause for person search Results are now ordered by lastName, first name (alphabetical) refs #223 --- Search/PersonSearch.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Search/PersonSearch.php b/Search/PersonSearch.php index 812fea242..b970e0462 100644 --- a/Search/PersonSearch.php +++ b/Search/PersonSearch.php @@ -99,7 +99,8 @@ class PersonSearch extends AbstractSearch $dql = 'SELECT p FROM ChillPersonBundle:Person p' . ' WHERE' . ' LOWER(p.firstName) like LOWER(:q)' - . ' OR LOWER(p.lastName) like LOWER(:q)'; + . ' OR LOWER(p.lastName) like LOWER(:q)' + . 'ORDER BY p.lastName, p.firstName'; $query = $this->om->createQuery($dql) ->setParameter('q', '%'.trim($pattern).'%')