PHP Class Pinq\Traversable

Author: Elliot Levin ([email protected])
Inheritance: implements pinq\ITraversable, implements Pinq\Interfaces\IOrderedTraversable
Afficher le fichier Open project: timetoogo/pinq Class Usage Examples

Protected Properties

Свойство 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.

Méthodes publiques

Méthode 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 )

Méthodes protégées

Méthode 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

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

Method Details

__construct() public méthode

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

aggregate() public méthode

public aggregate ( callable $function )
$function callable

all() public méthode

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

any() public méthode

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

append() public méthode

public append ( $values )

asArray() public méthode

public asArray ( )

asCollection() public méthode

public asCollection ( )

asOrderedMap() protected méthode

protected asOrderedMap ( ) : Pinq\Iterators\IOrderedMap
Résultat Pinq\Iterators\IOrderedMap

asTraversable() public méthode

public asTraversable ( )

average() public méthode

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

constructScopedSelf() protected méthode

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
Résultat static

contains() public méthode

public contains ( $value )

count() public méthode

public count ( )

difference() public méthode

public difference ( $values )

except() public méthode

public except ( $values )

factory() public static méthode

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
Résultat callable

first() public méthode

public first ( )

from() public static méthode

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
Résultat pinq\ITraversable

getIterator() public méthode

public getIterator ( )

getIteratorScheme() public méthode

public getIteratorScheme ( )

getSource() public méthode

public getSource ( )

getTrueIterator() public méthode

public getTrueIterator ( )

groupBy() public méthode

public groupBy ( callable $function )
$function callable

groupJoin() public méthode

public groupJoin ( $values )

implode() public méthode

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

indexBy() public méthode

public indexBy ( callable $function )
$function callable

intersect() public méthode

public intersect ( $values )

isEmpty() public méthode

public isEmpty ( )

isSource() public méthode

public isSource ( )

iterate() public méthode

public iterate ( callable $function )
$function callable

join() public méthode

public join ( $values )

keys() public méthode

public keys ( )

last() public méthode

public last ( )

maximum() public méthode

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

minimum() public méthode

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

offsetExists() public méthode

public offsetExists ( $index )

offsetGet() public méthode

public offsetGet ( $index )

offsetSet() public méthode

public offsetSet ( $index, $value )

offsetUnset() public méthode

public offsetUnset ( $index )

orderBy() public méthode

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

orderByAscending() public méthode

public orderByAscending ( callable $function )
$function callable

orderByDescending() public méthode

public orderByDescending ( callable $function )
$function callable

reindex() public méthode

public reindex ( )

scopedSelfFactory() final protected méthode

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

select() public méthode

public select ( callable $function )
$function callable

selectMany() public méthode

public selectMany ( callable $function )
$function callable

skip() public méthode

public skip ( $amount )

slice() public méthode

public slice ( $start, $amount )

sum() public méthode

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

take() public méthode

public take ( $amount )

thenBy() public méthode

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

thenByAscending() public méthode

public thenByAscending ( callable $function )
$function callable

thenByDescending() public méthode

public thenByDescending ( callable $function )
$function callable

union() public méthode

public union ( $values )

unique() public méthode

public unique ( )

where() public méthode

public where ( callable $predicate )
$predicate callable

whereIn() public méthode

public whereIn ( $values )

Property Details

$elements protected_oe property

The element iterator for the traversable.
protected Traversable,pinq $elements
Résultat Traversable

$scheme protected_oe property

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

$source protected_oe property

The source traversable.
protected Traversable,pinq|null $source
Résultat Traversable | null