class CachingIterator extends CachingIterator implements Countable

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
mixed read-only $nextKey
mixed read-only $nextValue

Methods

__construct(iterable|stdClass $iterable)

No description

bool
isFirst(int|null $gridWidth = null)

Is the current element the first one?

bool
isLast(int|null $gridWidth = null)

Is the current element the last one?

bool
isEmpty()

Is the iterator empty?

bool
isOdd()

Is the counter odd?

bool
isEven()

Is the counter even?

int
getCounter()

Returns the counter.

int
count()

Returns the count of elements.

void
next()

Forwards to the next element.

void
rewind()

Rewinds the Iterator.

mixed
getNextKey()

Returns the next key.

mixed
getNextValue()

Returns the next element.

Details

at line 34
__construct(iterable|stdClass $iterable)

No description

Parameters

iterable|stdClass $iterable

at line 46
bool isFirst(int|null $gridWidth = null)

Is the current element the first one?

Parameters

int|null $gridWidth

Return Value

bool

at line 55
bool isLast(int|null $gridWidth = null)

Is the current element the last one?

Parameters

int|null $gridWidth

Return Value

bool

at line 64
bool isEmpty()

Is the iterator empty?

Return Value

bool

at line 73
bool isOdd()

Is the counter odd?

Return Value

bool

at line 82
bool isEven()

Is the counter even?

Return Value

bool

at line 91
int getCounter()

Returns the counter.

Return Value

int

at line 100
int count()

Returns the count of elements.

Return Value

int

at line 115
void next()

Forwards to the next element.

Return Value

void

at line 127
void rewind()

Rewinds the Iterator.

Return Value

void

at line 137
mixed getNextKey()

Returns the next key.

Return Value

mixed

at line 146
mixed getNextValue()

Returns the next element.

Return Value

mixed

Traits

Strict class for better experience.