add order by on document list

This commit is contained in:
Julien Fastré 2022-04-19 15:46:10 +02:00
parent 7048f670ed
commit 26d5bf03bd
3 changed files with 3 additions and 3 deletions

View File

@ -155,7 +155,7 @@ class DocumentAccompanyingCourseController extends AbstractController
$documents = $this->courseRepository $documents = $this->courseRepository
->findBy( ->findBy(
['course' => $course], ['course' => $course],
['date' => 'DESC'], ['date' => 'DESC', 'id' => 'DESC'],
$pagination->getItemsPerPage(), $pagination->getItemsPerPage(),
$pagination->getCurrentPageFirstItemNumber() $pagination->getCurrentPageFirstItemNumber()
); );

View File

@ -178,7 +178,7 @@ class DocumentPersonController extends AbstractController
$documents = $this->personDocumentACLAwareRepository->findByPerson( $documents = $this->personDocumentACLAwareRepository->findByPerson(
$person, $person,
[], ['date' => 'DESC', 'id' => 'DESC'],
$pagination->getItemsPerPage(), $pagination->getItemsPerPage(),
$pagination->getCurrentPageFirstItemNumber() $pagination->getCurrentPageFirstItemNumber()
); );

View File

@ -64,7 +64,7 @@ class PersonDocumentACLAwareRepository implements PersonDocumentACLAwareReposito
$this->addACL($qb, $person); $this->addACL($qb, $person);
foreach ($orderBy as [$field, $order]) { foreach ($orderBy as $field => $order) {
$qb->addOrderBy($field, $order); $qb->addOrderBy($field, $order);
} }