add "order by" clause for person search

Results are now ordered by lastName, first name (alphabetical)

refs #223
This commit is contained in:
Julien Fastré 2014-11-25 22:44:49 +01:00
parent ff3479983e
commit 17fa1baedd

View File

@ -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).'%')