LimitIterator
class LimitIterator extends IteratorIterator (View source)
The LimitIterator class allows iteration over a limited subset of items in an Iterator.
Methods
Iterator|null
getInnerIterator()
Get inner iterator
void
rewind()
Rewind the iterator to the specified starting offset
bool
valid()
Check whether the current element is valid
TKey|null
key()
Get current key
TValue
current()
Get current element
void
next()
Move the iterator forward
int
seek(int $offset)
Seek to the given position
int
getPosition()
Return the current position
Details
__construct(Traversable $iterator, int $offset = 0, int $limit = -1)
Construct a LimitIterator
Iterator|null
getInnerIterator()
Get inner iterator
void
rewind()
Rewind the iterator to the specified starting offset
bool
valid()
Check whether the current element is valid
TKey|null
key()
Get current key
TValue
current()
Get current element
void
next()
Move the iterator forward
int
seek(int $offset)
Seek to the given position
int
getPosition()
Return the current position