Class SmartCachingIterator (namespace Nette)


Smarter caching interator.

CachingIterator
   |
   --SmartCachingIterator
Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /SmartCachingIterator.php (line 30)
Public Method Summary
SmartCachingIterator
__construct ($iterator)
int
Returns the counter.
int
Returns the current index (counter - 1).
bool
isEmpty ()
Is the iterator empty?
bool
isEven ()
Is the counter even?
bool
isFirst ()
Is the current element the first one?
bool
isLast ()
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 37

__construct

public SmartCachingIterator __construct ($iterator)

Input
$iterator
Output
SmartCachingIterator  

line 114

getCounter

public int getCounter ()

Returns the counter.

Output
int  

line 126

getIndex

public int getIndex ()

Returns the current index (counter - 1).

Output
int  
Tags
Deprecated

line 81

isEmpty

public bool isEmpty ()

Is the iterator empty?

Output
bool  

line 103

isEven

public bool isEven ()

Is the counter even?

Output
bool  

line 59

isFirst

public bool isFirst ()

Is the current element the first one?

Output
bool  

line 70

isLast

public bool isLast ()

Is the current element the last one?

Output
bool  

line 92

isOdd

public bool isOdd ()

Is the counter odd?

Output
bool  

line 137

next

public void next ()

Forwards to the next element.

Output
void  

line 151

rewind

public void rewind ()

Rewinds the Iterator.

Output
void  

line 171

__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 185

__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 213

__isset

public bool __isset (string $name)

Is property defined?

Input
string $name property name
Output
bool  

line 200

__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 227

__unset

public void __unset (string $name)

Access to undeclared property.

Input
string $name property name
Output
void  
Throws
throws MemberAccessException