Class SmartCachingIterator (namespace Nette)


Smarter caching interator.

CachingIterator
   |
   --SmartCachingIterator

Implements interfaces:

Countable (internal interface)
Copyright: Copyright (c) 2004, 2010 David Grudl
Located: in /SmartCachingIterator.php (line 27)
Public Method Summary
SmartCachingIterator
__construct ($iterator)
int
count ()
Returns the count of elements.
int
Returns the counter.
mixed
Returns the next key.
mixed
Returns the next element.
bool
isEmpty ()
Is the iterator empty?
bool
isEven ()
Is the counter even?
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
isOdd ()
Is the counter odd?
void
next ()
Forwards to the next element.
void
rewind ()
Rewinds the Iterator.
mixed
__call (string $name, array $args)
Call to undefined method.
& mixed
__get (string $name)
Returns property value. Do not call directly.
bool
__isset (string $name)
Is property defined?
void
__set (string $name, mixed $value)
Sets value of a property. Do not call directly.
void
__unset (string $name)
Access to undeclared property.
Methods Inherited From CachingIterator (Internal Class)
constructor __construct ( $iterator, [$flags = ] ), count ( ), current ( ), getCache ( ), getFlags ( ), getInnerIterator ( ), hasNext ( ), key ( ), next ( ), offsetExists ( $index ), offsetGet ( $index ), offsetSet ( $index, $newval ), offsetUnset ( $index ), rewind ( ), setFlags ( $flags ), valid ( ), __toString ( )
Constant Summary
Constants Inherited From CachingIterator (Internal Class)
CALL_TOSTRING = 1, CATCH_GET_CHILD = 16, FULL_CACHE = 256, TOSTRING_USE_CURRENT = 4, TOSTRING_USE_INNER = 8, TOSTRING_USE_KEY = 2

Method Details

line 34

__construct

public SmartCachingIterator __construct ($iterator)

Input
$iterator
Output
SmartCachingIterator  

line 124

count

public int count ()

Returns the count of elements.

Implementation of:

Countable::count
Output
int  

line 113

getCounter

public int getCounter ()

Returns the counter.

Output
int  

line 167

getNextKey

public mixed getNextKey ()

Returns the next key.

Output
mixed  

line 178

getNextValue

public mixed getNextValue ()

Returns the next element.

Output
mixed  

line 80

isEmpty

public bool isEmpty ()

Is the iterator empty?

Output
bool  

line 102

isEven

public bool isEven ()

Is the counter even?

Output
bool  

line 57

isFirst

public bool isFirst ([int $width = NULL])

Is the current element the first one?

Input
int $width grid width
Output
bool  

line 69

isLast

public bool isLast ([int $width = NULL])

Is the current element the last one?

Input
int $width grid width
Output
bool  

line 91

isOdd

public bool isOdd ()

Is the counter odd?

Output
bool  

line 141

next

public void next ()

Forwards to the next element.

Output
void  

line 155

rewind

public void rewind ()

Rewinds the Iterator.

Output
void  

line 197

__call

public mixed __call (string $name, array $args)

Call to undefined method.

Input
string $name method name
array $args arguments
Output
mixed  
Throws
throws MemberAccessException

line 211

__get

public mixed & __get (string $name)

Returns property value. Do not call directly.

Input
string $name property name
Output
& mixed property value
Throws
throws MemberAccessException if the property is not defined.

line 239

__isset

public bool __isset (string $name)

Is property defined?

Input
string $name property name
Output
bool  

line 226

__set

public void __set (string $name, mixed $value)

Sets value of a property. Do not call directly.

Input
string $name property name
mixed $value property value
Output
void  
Throws
throws MemberAccessException if the property is not defined or is read-only

line 253

__unset

public void __unset (string $name)

Access to undeclared property.

Input
string $name property name
Output
void  
Throws
throws MemberAccessException