MediaWiki  REL1_21
MappedIterator Class Reference

Convenience class for generating iterators from iterators. More...

List of all members.

Public Member Functions

 __construct ($iter, Closure $vCallback)
 Build an new iterator from a base iterator by having the former wrap the later, returning the result of "value" callback for each current() invocation.
 current ()
 key ()
 next ()
 rewind ()
 valid ()

Protected Attributes

Iterator $baseIterator
 *
Closure $vCallback
 *

Detailed Description

Convenience class for generating iterators from iterators.

Since:
1.21

Definition at line 29 of file MappedIterator.php.


Constructor & Destructor Documentation

MappedIterator::__construct ( iter,
Closure $  vCallback 
)

Build an new iterator from a base iterator by having the former wrap the later, returning the result of "value" callback for each current() invocation.

The callback takes the result of current() on the base iterator as an argument. The keys of the base iterator are reused verbatim.

Parameters:
Iterator | Array$iter
Closure$vCallback
Exceptions:
MWException

Definition at line 43 of file MappedIterator.php.


Member Function Documentation

Returns:
Mixed|null Returns null if out of range

Definition at line 64 of file MappedIterator.php.

Returns:
Mixed|null Returns null if out of range

Definition at line 74 of file MappedIterator.php.

Returns:
void

Definition at line 84 of file MappedIterator.php.

Returns:
void

Definition at line 57 of file MappedIterator.php.

Returns:
bool

Definition at line 91 of file MappedIterator.php.


Member Data Documentation

Iterator MappedIterator::$baseIterator [protected]

*

Definition at line 30 of file MappedIterator.php.

Closure MappedIterator::$vCallback [protected]

*

Definition at line 31 of file MappedIterator.php.


The documentation for this class was generated from the following file: