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

Methods

__construct($iterator)

No description

bool
isFirst(int $width = null)

Is the current element the first one?

bool
isLast(int $width = 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.

string
__toString()

Returns the counter as string

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.

__get($name)

Returns property value.

bool
__isset($name)

Is property defined?

Details

at line 36
__construct($iterator)

No description

Parameters

$iterator

at line 61
bool isFirst(int $width = null)

Is the current element the first one?

Parameters

int $width

Return Value

bool

at line 70
bool isLast(int $width = null)

Is the current element the last one?

Parameters

int $width

Return Value

bool

at line 79
bool isEmpty()

Is the iterator empty?

Return Value

bool

at line 88
bool isOdd()

Is the counter odd?

Return Value

bool

at line 97
bool isEven()

Is the counter even?

Return Value

bool

at line 106
int getCounter()

Returns the counter.

Return Value

int

at line 115
string __toString()

Returns the counter as string

Return Value

string

at line 124
int count()

Returns the count of elements.

Return Value

int

at line 139
void next()

Forwards to the next element.

Return Value

void

at line 151
void rewind()

Rewinds the Iterator.

Return Value

void

at line 162
mixed getNextKey()

Returns the next key.

Return Value

mixed

at line 172
mixed getNextValue()

Returns the next element.

Return Value

mixed

at line 185
__get($name)

Returns property value.

Parameters

$name

Exceptions

LogicException

at line 198
bool __isset($name)

Is property defined?

Parameters

$name

Return Value

bool

Traits

Better OOP experience.