Skip to content

Commit

Permalink
docs: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Apr 2, 2024
1 parent 14500fe commit 721025b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,12 @@ use Rekalogika\Rekapager\PageableInterface;
/** @var PageableInterface $pageable */
/** @var EntityManagerInterface $entityManager */

$page = $pageable->withItemsPerPage(1000)->getFirstPage();

while ($page = $page->getNextPage()) {
foreach ($pageable->withItemsPerPage(1000)->getPages() as $page) {
foreach ($page as $item) {
// Do something with the item
}

// Do something after each page here
$entityManager->flush(); // if required
$entitymanager->clear();
}
Expand Down

0 comments on commit 721025b

Please sign in to comment.