Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Paginator Iterator #7122

Merged

Conversation

tklever
Copy link
Contributor

@tklever tklever commented Jan 15, 2015

An OuterIterator to flatten Paginator objects.

Allows a developer to iterate over an entire paginated set as one loop. Not much of a use case with the ArrayAdapter, however, could be helpful with Paginator Adapters that fetch remote data.


use OuterIterator;

class PaginatorIterator implements OuterIterator
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be cool to document class as well

Copy link
Member

Choose a reason for hiding this comment

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

@keradus
Please report this at the issue tracker for documentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

To bo honest I do not see why.
I noticed that all props and methods have their own docs, even if it's just a copy-paste from php.net.
If docs for class should be done in separate repo then, imo, it should be done by author of PR.

@tklever
Copy link
Contributor Author

tklever commented Jan 26, 2015

Updated to add license as requested

@Ocramius
Copy link
Member

Ocramius commented Feb 1, 2015

@tklever what is exactly the use-case? I probably missed that... flatmapping lazy-loaded data?

@Ocramius Ocramius added this to the 2.4.0 milestone Feb 1, 2015
@tklever
Copy link
Contributor Author

tklever commented Feb 4, 2015

@Ocramius Use case (as I've used it) is flat mapping lazy-loaded data, specifically remote data. It also insulates code that needs to use / process that data from specific knowledge of Zend\Paginator.

It's also been helpful when passing paginated data to OuterIterators. If you want to want to run some kind of "MappingIterator" operation over a paginated data set, you can wrap it in this iterator first.

I realize you can set the Paginator to "-1" and get the entire data set, which makes this class somewhat redundant, but again, with remote data, often that's not ideal to grab those (potentially gigantic) data sets.

@weierophinney weierophinney merged commit 893ffa6 into zendframework:develop Feb 24, 2015
weierophinney added a commit that referenced this pull request Feb 24, 2015
weierophinney added a commit that referenced this pull request Feb 24, 2015
weierophinney added a commit to zendframework/zend-paginator that referenced this pull request May 15, 2015
…ure-paginator-iterator

Paginator Iterator
weierophinney added a commit to zendframework/zend-paginator that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants