mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Add pagination in the findBy()
This commit is contained in:
parent
ac33c6aad8
commit
d6cc69b919
@ -156,12 +156,15 @@ class DocumentPersonController extends AbstractController
|
||||
|
||||
$this->denyAccessUnlessGranted(PersonVoter::SEE, $person);
|
||||
|
||||
$documents = $this->personDocumentACLAwareRepository->findByPerson($person);
|
||||
|
||||
// wrong: count documents in database and retrieve document for this page.
|
||||
$total = $this->personDocumentACLAwareRepository->countByPerson($person);
|
||||
$pagination = $this->paginatorFactory->create($total);
|
||||
|
||||
$documents = $this->personDocumentACLAwareRepository->findByPerson(
|
||||
$person,
|
||||
[],
|
||||
$pagination->getItemsPerPage(),
|
||||
$pagination->getCurrentPageFirstItemNumber());
|
||||
|
||||
$event = new PrivacyEvent($person, [
|
||||
'element_class' => PersonDocument::class,
|
||||
'action' => 'index',
|
||||
|
Loading…
x
Reference in New Issue
Block a user