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

feature : Auto Paging Iterator #48

Merged
merged 4 commits into from
Apr 15, 2023
Merged

feature : Auto Paging Iterator #48

merged 4 commits into from
Apr 15, 2023

Conversation

kdubuc
Copy link
Contributor

@kdubuc kdubuc commented Apr 6, 2023

Add helper method to iterate through all pages results step by step without having to load the whole result into memory at once.

Avoid extreme memory consumption when batch processing over all pagination results.

Example :

$paginator = new Pagerfanta(new RemoteApiAdapter($api_filters, ...));

foreach($pagerfanta->autoPagingIterator() as $item) {
    // do things
}

see for details : #47

Do I need to add the method signature to PagerFantaInterface ? (add BC, and require a major version to implement autoPagingIterator)

@mbabker
Copy link
Member

mbabker commented Apr 6, 2023

Do I need to add the method signature to PagerFantaInterface ? (add BC, and require a major version to implement autoPagingIterator)

You can add it with a @method annotation as is done on the 2.x branch. This way, it doesn't need to force a new major release so quickly after tagging 4.0.

@kdubuc
Copy link
Contributor Author

kdubuc commented Apr 6, 2023

You can add it with a @method annotation

Done ! d432630

@kdubuc
Copy link
Contributor Author

kdubuc commented Apr 12, 2023

is it okay for you ? I updated docs to explain the Auto Pagination feature.
Do you have any merge ETA ?

@mbabker mbabker merged commit c3fc8a7 into BabDev:4.x Apr 15, 2023
40 checks passed
@mbabker
Copy link
Member

mbabker commented Apr 15, 2023

Released in 4.1.0.

@mbabker mbabker added the enhancement New feature or request label Apr 15, 2023
@kdubuc
Copy link
Contributor Author

kdubuc commented Apr 15, 2023

proud to be a contributor ! thank you

@kdubuc kdubuc deleted the feature-autopaginator branch April 15, 2023 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants