-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Paginator Iterator #7122
Paginator Iterator #7122
Conversation
|
||
use OuterIterator; | ||
|
||
class PaginatorIterator implements OuterIterator |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Updated to add license as requested |
@tklever what is exactly the use-case? I probably missed that... flatmapping lazy-loaded data? |
@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. |
…ure-paginator-iterator Paginator Iterator
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.