Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Paginators for Doctrine Collection & Selectable #6153

Merged

Conversation

priyadi
Copy link
Contributor

@priyadi priyadi commented Feb 11, 2024

Q A
Branch? main
Tickets
License MIT
Doc PR api-platform/docs#1895

Adds three paginators for Doctrine Collection & Selectable.

Some use cases:

use ApiPlatform\Doctrine\Common\SelectablePaginator;
use ApiPlatform\Doctrine\Common\CollectionPaginator;

/** @var BookRepository $repository */
$bookPaginator = new SelectablePaginator($repository, $currentPage, $itemsPerPage);

/** @var Book $book */
/** @var Collection<array-key,Chapter> */
$chapters = $book->getChapters();
$chapterPaginator = new CollectionPaginator($chapters, $currentPage, $itemsPerPage);

@priyadi priyadi force-pushed the feat/doctrine-collection-paginator branch 3 times, most recently from e6759d1 to 8f9af34 Compare February 11, 2024 11:09
@priyadi priyadi force-pushed the feat/doctrine-collection-paginator branch from 8f9af34 to 6da691b Compare February 11, 2024 11:15
@soyuka
Copy link
Member

soyuka commented Feb 12, 2024

wow that's quite awesome, wdyt @dunglas ?

Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@soyuka soyuka merged commit 79fe01b into api-platform:main Feb 16, 2024
72 checks passed
@soyuka
Copy link
Member

soyuka commented Feb 16, 2024

thanks @priyadi !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants