Creates a filtered iterator from another iterator. The filtering is done by passing a callback function to each of the elements and taking them out if it does not return true.
__construct( Iterator $items , callable $callback )
Creates a filtered iterator using the callback to determine which items are accepted or rejected.
Each time the callback is executed it will receive the value of the element in the current iteration, the key of the element and the passed $items iterator as arguments, in that order.
$items
$callback
InvalidArgumentException
Cake\Collection\Collection::__construct()
__debugInfo( )
Returns an array that can be used to describe the internal state of this object.
array
count( )
Throws an exception.
Issuing a count on a Collection can have many side effects, some making the Collection unusable after the count operation.
LogicException
serialize( )
Returns a string representation of this object that can be used to reconstruct it
string
Serializable::serialize()
unserialize( string $collection )
Unserializes the passed string and rebuilds the Collection instance
$collection
Serializable::unserialize()
_unwrap( )
Backwards compatible wrapper for unwrap()
Iterator
append( mixed $items )
Cake\Collection\CollectionInterface::append()
buffered( )
Cake\Collection\Iterator\BufferedIterator
Cake\Collection\CollectionInterface::buffered()
chunk( mixed $chunkSize )
Cake\Collection\CollectionInterface::chunk()
combine( mixed $keyPath , mixed $valuePath , mixed $groupPath null )
Cake\Collection\CollectionInterface::combine()
compile( mixed $preserveKeys true )
Cake\Collection\CollectionInterface::compile()
contains( mixed $value )
Cake\Collection\CollectionInterface::contains()
countBy( mixed $callback )
Cake\Collection\CollectionInterface::countBy()
every( callable $c )
Cake\Collection\CollectionInterface::every()
extract( mixed $matcher )
Cake\Collection\CollectionInterface::extract()
filter( callable $c null )
Cake\Collection\Iterator\FilterIterator
Cake\Collection\CollectionInterface::filter()
firstMatch( array $conditions )
Cake\Collection\CollectionInterface::firstMatch()
groupBy( mixed $callback )
Cake\Collection\CollectionInterface::groupBy()
indexBy( mixed $callback )
Cake\Collection\CollectionInterface::indexBy()
insert( mixed $path , mixed $values )
Cake\Collection\Iterator\InsertIterator
Cake\Collection\CollectionInterface::insert()
jsonSerialize( )
Cake\Collection\CollectionInterface::jsonSerialize()
listNested( mixed $dir 'desc' , mixed $nestingKey 'children' )
Cake\Collection\Iterator\TreeIterator
Cake\Collection\CollectionInterface::listNested()
map( callable $c )
Cake\Collection\Iterator\ReplaceIterator
Cake\Collection\CollectionInterface::map()
match( array $conditions )
Cake\Collection\CollectionInterface::match()
max( mixed $callback , mixed $type SORT_NUMERIC )
Cake\Collection\CollectionInterface::max()
min( mixed $callback , mixed $type SORT_NUMERIC )
Cake\Collection\CollectionInterface::min()
nest( mixed $idPath , mixed $parentPath )
Cake\Collection\CollectionInterface::nest()
reduce( callable $c , mixed $zero null )
Cake\Collection\CollectionInterface::reduce()
reject( callable $c )
Cake\Collection\Iterator\FilterIterator
Cake\Collection\CollectionInterface::reject()
sample( mixed $size 10 )
Cake\Collection\CollectionInterface::sample()
skip( mixed $howMany )
Cake\Collection\CollectionInterface::skip()
sortBy( mixed $callback , mixed $dir SORT_DESC , mixed $type SORT_NUMERIC )
Cake\Collection\CollectionInterface::sortBy()
stopWhen( mixed $condition )
Cake\Collection\Iterator\StoppableIterator
Cake\Collection\CollectionInterface::stopWhen()
sumOf( mixed $matcher null )
Cake\Collection\CollectionInterface::sumOf()
take( mixed $size 1 , mixed $from 0 )
Cake\Collection\CollectionInterface::take()
through( callable $handler )
Cake\Collection\CollectionInterface::through()
toArray( mixed $preserveKeys true )
Cake\Collection\CollectionInterface::toArray()
unfold( callable $transformer null )
Cake\Collection\CollectionInterface::unfold()
zipWith( mixed $items , mixed $callable )
Cake\Collection\CollectionInterface::zipWith()
_createMatcherFilter( array $conditions )
Returns a callable that receives a value and will return whether or not it matches certain condition.
$conditions
callable
_extract( array|ArrayAccess $data , array $path )
Returns a column from $data that can be extracted by iterating over the column names contained in $path. It will return arrays for elements in represented with {*}
$data
$path
mixed
_propertyExtractor( string|callable $callback )
Returns a callable that can be used to extract a property or column from an array or object based on a dot separated path.
$callback
callable
_simpleExtract( array|ArrayAccess $data , array $path )
Returns a column from $data that can be extracted by iterating over the column names contained in $path
$data
$path
mixed
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.Collection.Iterator.FilterIterator.html