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)
|
->setMaxResults($limit)
|
||||||
->setFirstResult($start);
|
->setFirstResult($start);
|
||||||
|
|
||||||
|
//order by firstname, lastname
|
||||||
|
|
||||||
|
$qb->orderBy('p.firstName')
|
||||||
|
->addOrderBy('p.lastName');
|
||||||
|
|
||||||
return $qb->getQuery()->getResult();
|
return $qb->getQuery()->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +152,7 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface
|
|||||||
//get from cache
|
//get from cache
|
||||||
$cacheKey = md5(serialize($terms));
|
$cacheKey = md5(serialize($terms));
|
||||||
if (array_key_exists($cacheKey, $this->_cacheQuery)) {
|
if (array_key_exists($cacheKey, $this->_cacheQuery)) {
|
||||||
return $this->_cacheQuery[$cacheKey];
|
return clone $this->_cacheQuery[$cacheKey];
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb = $this->em->createQueryBuilder();
|
$qb = $this->em->createQueryBuilder();
|
||||||
@ -220,10 +225,10 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface
|
|||||||
->in('p.center', ':centers'))
|
->in('p.center', ':centers'))
|
||||||
->setParameter('centers', $reachableCenters)
|
->setParameter('centers', $reachableCenters)
|
||||||
;
|
;
|
||||||
|
|
||||||
$this->_cacheQuery[$cacheKey] = $qb;
|
$this->_cacheQuery[$cacheKey] = $qb;
|
||||||
|
|
||||||
return $qb;
|
return clone $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user