PHP Class Pinq\Traversable

Author: Elliot Levin ([email protected])
Inheritance: implements pinq\ITraversable, implements Pinq\Interfaces\IOrderedTraversable
ファイルを表示 Open project: timetoogo/pinq Class Usage Examples

Protected Properties

Property Type Description
$elements Traversable The element iterator for the traversable.
$scheme Pinq\Iterators\IIteratorScheme The iterator scheme used in the traversable instance.
$source Traversable | null The source traversable.

Public Methods

Method Description
__construct ( $elements = [], Pinq\Iterators\IIteratorScheme $scheme = null, Traversable $source = null )
aggregate ( callable $function )
all ( callable $function = null )
any ( callable $function = null )
append ( $values )
asArray ( )
asCollection ( )
asTraversable ( )
average ( callable $function = null )
contains ( $value )
count ( )
difference ( $values )
except ( $values )
factory ( Pinq\Iterators\IIteratorScheme $scheme = null, Traversable $source = null ) : callable Returns a callable for the traversable constructor.
first ( )
from ( array | Traversable $elements, Pinq\Iterators\IIteratorScheme $scheme = null, Traversable $source = null ) : pinq\ITraversable Constructs a new traversable object from the supplied elements.
getIterator ( )
getIteratorScheme ( )
getSource ( )
getTrueIterator ( )
groupBy ( callable $function )
groupJoin ( $values )
implode ( $delimiter, callable $function = null )
indexBy ( callable $function )
intersect ( $values )
isEmpty ( )
isSource ( )
iterate ( callable $function )
join ( $values )
keys ( )
last ( )
maximum ( callable $function = null )
minimum ( callable $function = null )
offsetExists ( $index )
offsetGet ( $index )
offsetSet ( $index, $value )
offsetUnset ( $index )
orderBy ( callable $function, $direction )
orderByAscending ( callable $function )
orderByDescending ( callable $function )
reindex ( )
select ( callable $function )
selectMany ( callable $function )
skip ( $amount )
slice ( $start, $amount )
sum ( callable $function = null )
take ( $amount )
thenBy ( callable $function, $direction )
thenByAscending ( callable $function )
thenByDescending ( callable $function )
union ( $values )
unique ( )
where ( callable $predicate )
whereIn ( $values )

Protected Methods

Method Description
asOrderedMap ( ) : Pinq\Iterators\IOrderedMap
constructScopedSelf ( array | Traversable $elements ) : static Returns a new instance of the traversable with the scoped elements and same scheme and source.
scopedSelfFactory ( ) : callable Returns a callable factory to construct an equivalent instance with the supplied elements.

Private Methods

Method Description
mapIterator ( callable $function = null )
validateIsOrdered ( string $method ) : Pinq\Iterators\IOrderedIterator Verifies that the traversable is ordered.

Method Details

__construct() public method

public __construct ( $elements = [], Pinq\Iterators\IIteratorScheme $scheme = null, Traversable $source = null )
$scheme Pinq\Iterators\IIteratorScheme
$source Traversable

aggregate() public method

public aggregate ( callable $function )
$function callable

all() public method

public all ( callable $function = null )
$function callable

any() public method

public any ( callable $function = null )
$function callable

append() public method

public append ( $values )

asArray() public method

public asArray ( )

asCollection() public method

public asCollection ( )

asOrderedMap() protected method

protected asOrderedMap ( ) : Pinq\Iterators\IOrderedMap
return Pinq\Iterators\IOrderedMap

asTraversable() public method

public asTraversable ( )

average() public method

public average ( callable $function = null )
$function callable

constructScopedSelf() protected method

Returns a new instance of the traversable with the scoped elements and same scheme and source.
protected constructScopedSelf ( array | Traversable $elements ) : static
$elements array | Traversable
return static

contains() public method

public contains ( $value )

count() public method

public count ( )

difference() public method

public difference ( $values )

except() public method

public except ( $values )

factory() public static method

Returns a callable for the traversable constructor.
public static factory ( Pinq\Iterators\IIteratorScheme $scheme = null, Traversable $source = null ) : callable
$scheme Pinq\Iterators\IIteratorScheme
$source Traversable
return callable

first() public method

public first ( )

from() public static method

Constructs a new traversable object from the supplied elements.
public static from ( array | Traversable $elements, Pinq\Iterators\IIteratorScheme $scheme = null, Traversable $source = null ) : pinq\ITraversable
$elements array | Traversable
$scheme Pinq\Iterators\IIteratorScheme
$source Traversable
return pinq\ITraversable

getIterator() public method

public getIterator ( )

getIteratorScheme() public method

public getIteratorScheme ( )

getSource() public method

public getSource ( )

getTrueIterator() public method

public getTrueIterator ( )

groupBy() public method

public groupBy ( callable $function )
$function callable

groupJoin() public method

public groupJoin ( $values )

implode() public method

public implode ( $delimiter, callable $function = null )
$function callable

indexBy() public method

public indexBy ( callable $function )
$function callable

intersect() public method

public intersect ( $values )

isEmpty() public method

public isEmpty ( )

isSource() public method

public isSource ( )

iterate() public method

public iterate ( callable $function )
$function callable

join() public method

public join ( $values )

keys() public method

public keys ( )

last() public method

public last ( )

maximum() public method

public maximum ( callable $function = null )
$function callable

minimum() public method

public minimum ( callable $function = null )
$function callable

offsetExists() public method

public offsetExists ( $index )

offsetGet() public method

public offsetGet ( $index )

offsetSet() public method

public offsetSet ( $index, $value )

offsetUnset() public method

public offsetUnset ( $index )

orderBy() public method

public orderBy ( callable $function, $direction )
$function callable

orderByAscending() public method

public orderByAscending ( callable $function )
$function callable

orderByDescending() public method

public orderByDescending ( callable $function )
$function callable

reindex() public method

public reindex ( )

scopedSelfFactory() final protected method

Returns a callable factory to construct an equivalent instance with the supplied elements.
final protected scopedSelfFactory ( ) : callable
return callable

select() public method

public select ( callable $function )
$function callable

selectMany() public method

public selectMany ( callable $function )
$function callable

skip() public method

public skip ( $amount )

slice() public method

public slice ( $start, $amount )

sum() public method

public sum ( callable $function = null )
$function callable

take() public method

public take ( $amount )

thenBy() public method

public thenBy ( callable $function, $direction )
$function callable

thenByAscending() public method

public thenByAscending ( callable $function )
$function callable

thenByDescending() public method

public thenByDescending ( callable $function )
$function callable

union() public method

public union ( $values )

unique() public method

public unique ( )

where() public method

public where ( callable $predicate )
$predicate callable

whereIn() public method

public whereIn ( $values )

Property Details

$elements protected_oe property

The element iterator for the traversable.
protected Traversable,pinq $elements
return Traversable

$scheme protected_oe property

The iterator scheme used in the traversable instance.
protected IIteratorScheme,Pinq\Iterators $scheme
return Pinq\Iterators\IIteratorScheme

$source protected_oe property

The source traversable.
protected Traversable,pinq|null $source
return Traversable | null