PHP Class Prooph\EventStore\Util\CompositeIterator

Inheritance: implements Iterato\Iterator
Show file Open project: prooph/event-store Class Usage Examples

Public Methods

Method Description
__construct ( array $iterators, callable $callback )
current ( ) : mixed Return the current element
key ( ) : mixed Return the key of the current element Note: You should not rely on the key, unless the key tracks information from which iterator it comes
next ( ) : void Move forward to next element
rewind ( ) Rewind the Iterator to the first element
valid ( ) : boolean Checks if current position is valid

Private Methods

Method Description
nextIterator ( ) : Iterator

Method Details

__construct() public method

public __construct ( array $iterators, callable $callback )
$iterators array
$callback callable

current() public method

Return the current element
public current ( ) : mixed
return mixed

key() public method

Return the key of the current element Note: You should not rely on the key, unless the key tracks information from which iterator it comes
public key ( ) : mixed
return mixed scalar on success, or null on failure.

next() public method

Move forward to next element
public next ( ) : void
return void

rewind() public method

Rewind the Iterator to the first element
public rewind ( )

valid() public method

Checks if current position is valid
public valid ( ) : boolean
return boolean