mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
order results in person search by firstname and lastname
This commit is contained in:
parent
1577076c93
commit
4e34485d8d
@ -122,6 +122,11 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface
|
||||
->setMaxResults($limit)
|
||||
->setFirstResult($start);
|
||||
|
||||
//order by firstname, lastname
|
||||
|
||||
$qb->orderBy('p.firstName')
|
||||
->addOrderBy('p.lastName');
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
@ -147,7 +152,7 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface
|
||||
//get from cache
|
||||
$cacheKey = md5(serialize($terms));
|
||||
if (array_key_exists($cacheKey, $this->_cacheQuery)) {
|
||||
return $this->_cacheQuery[$cacheKey];
|
||||
return clone $this->_cacheQuery[$cacheKey];
|
||||
}
|
||||
|
||||
$qb = $this->em->createQueryBuilder();
|
||||
@ -223,7 +228,7 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface
|
||||
|
||||
$this->_cacheQuery[$cacheKey] = $qb;
|
||||
|
||||
return $qb;
|
||||
return clone $qb;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user