PHP 인터페이스 Pinq\ITraversable

Query calls must be immutable and return a new instance with every query call. Queries should also be executed lazily upon iteration.
저자: Elliot Levin ([email protected])
상속: extends pinq\IAggregatable, extends IteratorAggregate, extends ArrayAccess
파일 보기 프로젝트 열기: timetoogo/pinq 0 사용 예제들

공개 메소드들

메소드 설명
append ( array | Traversable $values ) : pinq\ITraversable Returns values from the original and supplied values, keys will be reindexed.
asArray ( ) : array Returns the values as an array.
asCollection ( ) : pinq\ICollection Returns the values as a collection.
asTraversable ( ) : pinq\ITraversable Returns the values as a traversable.
contains ( mixed $value ) : boolean Returns whether the supplied value is contained within the aggregate
difference ( array | Traversable $values ) : pinq\ITraversable Returns unique values from the original not present in the supplied values.
except ( array | Traversable $values ) : pinq\ITraversable Returns values all values from the original not present in the supplied values.
first ( ) : mixed Returns the first value, null if empty
getIterator ( ) : Traversable Returns an array compatible iterator for the elements.
getIteratorScheme ( ) : Pinq\Iterators\IIteratorScheme Returns the underlying iterator scheme used by the implementation.
getSource ( ) : pinq\ITraversable Returns the source traversable or itself if the current traversable is the source.
getTrueIterator ( ) : Traversable Returns an iterator for all the elements.
groupBy ( callable $function ) : pinq\ITraversable Groups values according the supplied function. (Uses strict equality '===') The values will be grouped into instances of the traversable.
groupJoin ( array | Traversable $values ) : Pinq\Interfaces\IJoiningOnTraversable Matches the values with the supplied values according to the supplied filter, groups the the joined values for every original and then maps into as according to the supplied function.
indexBy ( callable $function ) : pinq\ITraversable Index the values according to the supplied mapping function.
intersect ( array | Traversable $values ) : pinq\ITraversable Returns unique values the are present in the original and supplied values.
isSource ( ) : boolean Returns whether the traversable is the source of the elements.
iterate ( callable $function ) : void Iterates the elements with the supplied function.
join ( array | Traversable $values ) : Pinq\Interfaces\IJoiningOnTraversable Matches the values with the supplied values according to the supplied filter then maps the results into as according to the supplied function.
keys ( ) : pinq\ITraversable Selects the keys as the values (indexed by their 0-based position).
last ( ) : mixed Returns the last value, null if empty
orderBy ( callable $function, integer $direction ) : Pinq\Interfaces\IOrderedTraversable Orders the values mapped from the supplied function according the supplied direction.
orderByAscending ( callable $function ) : Pinq\Interfaces\IOrderedTraversable Orders the values mapped from the supplied function ascendingly Example function:
orderByDescending ( callable $function ) : Pinq\Interfaces\IOrderedTraversable Orders the values mapped from the supplied function descendingly Example expression function:
reindex ( ) : pinq\ITraversable Indexes the values by their 0-based position.
select ( callable $function ) : pinq\ITraversable Returns the values mapped by the supplied function.
selectMany ( callable $function ) : pinq\ITraversable Returns the values mapped by the supplied function and then flattens the values into a single traversable. Keys will be reindexed.
skip ( integer $amount ) : pinq\ITraversable Skip the amount of values from the start.
slice ( integer $start, integer | null $amount ) : pinq\ITraversable Retrieve a slice of the values.
take ( integer | null $amount ) : pinq\ITraversable Limits the amount of values by the supplied amount
union ( array | Traversable $values ) : pinq\ITraversable Returns unique results present in both the original and supplied values, keys will be reindexed.
unique ( ) : pinq\ITraversable Only return unique values. (Uses strict equality '===')
where ( callable $predicate ) : pinq\ITraversable Filters the values by a supplied predicate.
whereIn ( array | Traversable $values ) : pinq\ITraversable Returns all values from the original present in the supplied values.

메소드 상세

append() 공개 메소드

Returns values from the original and supplied values, keys will be reindexed.
public append ( array | Traversable $values ) : pinq\ITraversable
$values array | Traversable The values to append
리턴 pinq\ITraversable

asArray() 공개 메소드

Only valid array keys (strings or integers) will be used, all others will be reindexed numerically.
public asArray ( ) : array
리턴 array

asCollection() 공개 메소드

The following queries will be performed in memory.
public asCollection ( ) : pinq\ICollection
리턴 pinq\ICollection

asTraversable() 공개 메소드

The following queries will be performed in memory.
public asTraversable ( ) : pinq\ITraversable
리턴 pinq\ITraversable

contains() 공개 메소드

Returns whether the supplied value is contained within the aggregate
public contains ( mixed $value ) : boolean
$value mixed The value to check for
리턴 boolean

difference() 공개 메소드

(Uses strict equality '===')
public difference ( array | Traversable $values ) : pinq\ITraversable
$values array | Traversable The values to remove
리턴 pinq\ITraversable

except() 공개 메소드

(Uses strict equality '===')
public except ( array | Traversable $values ) : pinq\ITraversable
$values array | Traversable The values to union
리턴 pinq\ITraversable

first() 공개 메소드

Returns the first value, null if empty
public first ( ) : mixed
리턴 mixed The first value

getIterator() 공개 메소드

Non string or integer keys will be numerically reindexed.
public getIterator ( ) : Traversable
리턴 Traversable

getIteratorScheme() 공개 메소드

Returns the underlying iterator scheme used by the implementation.
public getIteratorScheme ( ) : Pinq\Iterators\IIteratorScheme
리턴 Pinq\Iterators\IIteratorScheme

getSource() 공개 메소드

Returns the source traversable or itself if the current traversable is the source.
public getSource ( ) : pinq\ITraversable
리턴 pinq\ITraversable

getTrueIterator() 공개 메소드

All keys types will remain unaltered.
public getTrueIterator ( ) : Traversable
리턴 Traversable

groupBy() 공개 메소드

This will implicitly index each group by the group key returned from the supplied function.
public groupBy ( callable $function ) : pinq\ITraversable
$function callable The grouping function
리턴 pinq\ITraversable

groupJoin() 공개 메소드

Matches the values with the supplied values according to the supplied filter, groups the the joined values for every original and then maps into as according to the supplied function.
public groupJoin ( array | Traversable $values ) : Pinq\Interfaces\IJoiningOnTraversable
$values array | Traversable
리턴 Pinq\Interfaces\IJoiningOnTraversable

indexBy() 공개 메소드

All duplicate indexes will be associated with the first value for that index.
public indexBy ( callable $function ) : pinq\ITraversable
$function callable The projection function
리턴 pinq\ITraversable

intersect() 공개 메소드

(Uses strict equality '===')
public intersect ( array | Traversable $values ) : pinq\ITraversable
$values array | Traversable The values to intersect with
리턴 pinq\ITraversable

isSource() 공개 메소드

Returns whether the traversable is the source of the elements.
public isSource ( ) : boolean
리턴 boolean

iterate() 공개 메소드

Returning false will break the iteration loop.
public iterate ( callable $function ) : void
$function callable The iteration function, parameters are passed as ($value, $key)
리턴 void

join() 공개 메소드

Matches the values with the supplied values according to the supplied filter then maps the results into as according to the supplied function.
public join ( array | Traversable $values ) : Pinq\Interfaces\IJoiningOnTraversable
$values array | Traversable
리턴 Pinq\Interfaces\IJoiningOnTraversable

keys() 공개 메소드

Selects the keys as the values (indexed by their 0-based position).
public keys ( ) : pinq\ITraversable
리턴 pinq\ITraversable

last() 공개 메소드

Returns the last value, null if empty
public last ( ) : mixed
리턴 mixed The last value

orderBy() 공개 메소드

Orders the values mapped from the supplied function according the supplied direction.
public orderBy ( callable $function, integer $direction ) : Pinq\Interfaces\IOrderedTraversable
$function callable The projection function
$direction integer
리턴 Pinq\Interfaces\IOrderedTraversable

orderByAscending() 공개 메소드

Orders the values mapped from the supplied function ascendingly Example function:
public orderByAscending ( callable $function ) : Pinq\Interfaces\IOrderedTraversable
$function callable The mapping function
리턴 Pinq\Interfaces\IOrderedTraversable

orderByDescending() 공개 메소드

Orders the values mapped from the supplied function descendingly Example expression function:
public orderByDescending ( callable $function ) : Pinq\Interfaces\IOrderedTraversable
$function callable The mapping function
리턴 Pinq\Interfaces\IOrderedTraversable

reindex() 공개 메소드

Indexes the values by their 0-based position.
public reindex ( ) : pinq\ITraversable
리턴 pinq\ITraversable

select() 공개 메소드

Returns the values mapped by the supplied function.
public select ( callable $function ) : pinq\ITraversable
$function callable The function returning the data to select
리턴 pinq\ITraversable

selectMany() 공개 메소드

Returns the values mapped by the supplied function and then flattens the values into a single traversable. Keys will be reindexed.
public selectMany ( callable $function ) : pinq\ITraversable
$function callable The function returning the data to select
리턴 pinq\ITraversable

skip() 공개 메소드

Skip the amount of values from the start.
public skip ( integer $amount ) : pinq\ITraversable
$amount integer The amount of values to skip, must be > 0
리턴 pinq\ITraversable

slice() 공개 메소드

Retrieve a slice of the values.
public slice ( integer $start, integer | null $amount ) : pinq\ITraversable
$start integer The amount of values to skip
$amount integer | null The amount of values to retrieve
리턴 pinq\ITraversable

take() 공개 메소드

Limits the amount of values by the supplied amount
public take ( integer | null $amount ) : pinq\ITraversable
$amount integer | null The amount of values to retrieve, must be > 0 or null if all
리턴 pinq\ITraversable

union() 공개 메소드

(Uses strict equality '===')
public union ( array | Traversable $values ) : pinq\ITraversable
$values array | Traversable The values to union
리턴 pinq\ITraversable

unique() 공개 메소드

Only return unique values. (Uses strict equality '===')
public unique ( ) : pinq\ITraversable
리턴 pinq\ITraversable

where() 공개 메소드

Filters the values by a supplied predicate.
public where ( callable $predicate ) : pinq\ITraversable
$predicate callable The predicate function
리턴 pinq\ITraversable

whereIn() 공개 메소드

(Uses strict equality '===')
public whereIn ( array | Traversable $values ) : pinq\ITraversable
$values array | Traversable
리턴 pinq\ITraversable