CachingIterator
class CachingIterator extends CachingIterator implements Countable
internal |
Smarter caching iterator.
Properties
bool read-only | $first | ||
bool read-only | $last | ||
bool read-only | $empty | ||
bool read-only | $odd | ||
bool read-only | $even | ||
int read-only | $counter | ||
int read-only | $counter0 | ||
mixed read-only | $nextKey | ||
mixed read-only | $nextValue | ||
?self read-only | $parent |
Methods
Is the current element the first one?
Is the current element the last one?
Is the iterator empty?
Is the counter odd?
Is the counter even?
Returns the 1-indexed counter.
Returns the 0-indexed counter.
Decrements counter.
Returns the counter as string
Returns the count of elements.
Forwards to the next element.
Rewinds the Iterator.
Returns the next key or null if position is not valid.
Returns the next element or null if position is not valid.
Returns the iterator surrounding the current one.
Returns property value.
Is property defined?
Details
at line 38
__construct(mixed $iterator, CachingIterator|null $parent = null)
No description
at line 63
bool
isFirst(int|null $width = null)
Is the current element the first one?
at line 72
bool
isLast(int|null $width = null)
Is the current element the last one?
at line 81
bool
isEmpty()
Is the iterator empty?
at line 90
bool
isOdd()
Is the counter odd?
at line 99
bool
isEven()
Is the counter even?
at line 108
int
getCounter()
Returns the 1-indexed counter.
at line 117
int
getCounter0()
Returns the 0-indexed counter.
at line 126
void
skipRound()
Decrements counter.
at line 135
string
__toString()
Returns the counter as string
at line 144
int
count()
Returns the count of elements.
at line 159
void
next()
Forwards to the next element.
at line 171
void
rewind()
Rewinds the Iterator.
at line 181
mixed
getNextKey()
Returns the next key or null if position is not valid.
at line 191
mixed
getNextValue()
Returns the next element or null if position is not valid.
at line 201
CachingIterator|null
getParent()
Returns the iterator surrounding the current one.
at line 214
mixed
__get(string $name)
Returns property value.
at line 228
bool
__isset(string $name)
Is property defined?
Traits
Better OOP experience.