Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
KeyListIterator Class Reference

Public Member Functions

 __construct (StorageInterface $storage, array $keys)
 Constructor.
 
 getStorage ()
 Get storage instance.
 
 getMode ()
 Get iterator mode.
 
 setMode ($mode)
 Set iterator mode.
 
 current ()
 Get current key, value or metadata.
 
 key ()
 Get current key.
 
 valid ()
 Checks if current position is valid.
 
 next ()
 Move forward to next element.
 
 rewind ()
 Rewind the Iterator to the first element.
 
 count ()
 Count number of items.
 

Protected Attributes

 $storage
 
 $mode = IteratorInterface::CURRENT_AS_KEY
 
 $keys
 
 $count
 
 $position = 0
 

Additional Inherited Members

- Public Attributes inherited from IteratorInterface
const CURRENT_AS_SELF = 0
 
const CURRENT_AS_KEY = 1
 
const CURRENT_AS_VALUE = 2
 
const CURRENT_AS_METADATA = 3
 

Constructor & Destructor Documentation

__construct ( StorageInterface  $storage,
array  $keys 
)

Constructor.

Parameters
StorageInterface$storage
array$keys

Member Function Documentation

count ( )

Count number of items.

Returns
int
current ( )

Get current key, value or metadata.

Returns
mixed
getMode ( )

Get iterator mode.

Returns
int Value of IteratorInterface::CURRENT_AS_*

Implements IteratorInterface.

getStorage ( )

Get storage instance.

Returns
StorageInterface

Implements IteratorInterface.

key ( )

Get current key.

Returns
string
next ( )

Move forward to next element.

Returns
void
rewind ( )

Rewind the Iterator to the first element.

Returns
void
setMode (   $mode)

Set iterator mode.

Parameters
int$mode
Returns
KeyListIterator Fluent interface

Implements IteratorInterface.

valid ( )

Checks if current position is valid.

Returns
bool

Member Data Documentation

$count
protected
$keys
protected
$position = 0
protected
$storage
protected