mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
adding an order on person list widget
This commit is contained in:
parent
89aa9a0fb4
commit
771fa68c2f
@ -110,7 +110,7 @@ class PersonListWidget implements WidgetInterface
|
||||
// add the case where closingDate IS NULL
|
||||
$andWhenClosingDateIsNull = new Expr\Andx();
|
||||
$andWhenClosingDateIsNull->add((new Expr())->isNull('ap.closingDate'));
|
||||
$andWhenClosingDateIsNull->add ((new Expr())->gte(':now', 'ap.openingDate'));
|
||||
$andWhenClosingDateIsNull->add((new Expr())->gte(':now', 'ap.openingDate'));
|
||||
$or->add($andWhenClosingDateIsNull);
|
||||
// add the case when closingDate is in the future
|
||||
$or->add(
|
||||
@ -138,6 +138,10 @@ class PersonListWidget implements WidgetInterface
|
||||
// adding the where clause to the query
|
||||
$qb->where($and);
|
||||
|
||||
// ordering the query by lastname, firstname
|
||||
$qb->addOrderBy('person.lastName', 'ASC')
|
||||
->addOrderBy('person.firstName', 'ASC');
|
||||
|
||||
|
||||
$qb->setFirstResult(0)->setMaxResults($config['number_of_items']);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user