Class ResultSetDecorator
Generic ResultSet decorator. This will make any traversable object appear to be a database result
- IteratorIterator implements Iterator, Traversable, OuterIterator
- Cake\Collection\Collection implements Cake\Collection\CollectionInterface, Serializable uses Cake\Collection\CollectionTrait
- Cake\Datasource\ResultSetDecorator implements Cake\Datasource\ResultSetInterface
Method Summary
- count() publicMake this object countable.
Method Detail
count()source public
count( )
Make this object countable.
Part of the Countable interface. Calling this method will convert the underlying traversable object into an array and get the count of the underlying data.
Returns
integerThrows
LogicExceptionOverrides
Cake\Collection\Collection::count()
Implementation of
Countable::count()
Methods inherited from Cake\Collection\Collection
__construct()source public
__construct( array|Traversable $items )
Constructor. You can provide an array or any traversable object
Parameters
- array|Traversable
$items
- Items.
Throws
InvalidArgumentExceptionIf passed incorrect type for items.
Overrides
IteratorIterator::__construct()
__debugInfo()source public
__debugInfo( )
Returns an array that can be used to describe the internal state of this object.
Returns
arrayserialize()source public
serialize( )
Returns a string representation of this object that can be used to reconstruct it
Returns
stringImplementation of
Serializable::serialize()
unserialize()source public
unserialize( string $collection )
Unserializes the passed string and rebuilds the Collection instance
Parameters
- string
$collection
- The serialized collection
Implementation of
Serializable::unserialize()
Methods used from Cake\Collection\CollectionTrait
_unwrap()source public
_unwrap( )
append()source public
append( $items )
avg()source public
avg( $matcher null )
cartesianProduct()source public
cartesianProduct( callable $operation null , callable $filter null )
Returns
Cake\Collection\CollectionInterface
chunk()source public
chunk( $chunkSize )
chunkWithKeys()source public
chunkWithKeys( $chunkSize , $preserveKeys true )
combine()source public
combine( $keyPath , $valuePath , $groupPath null )
compile()source public
compile( $preserveKeys true )
contains()source public
contains( $value )
countBy()source public
countBy( $callback )
each()source public
each( callable $c )
every()source public
every( callable $c )
extract()source public
extract( $matcher )
first()source public
first( )
firstMatch()source public
firstMatch( array $conditions )
groupBy()source public
groupBy( $callback )
indexBy()source public
indexBy( $callback )
isEmpty()source public
isEmpty( )
jsonSerialize()source public
jsonSerialize( )
last()source public
last( )
listNested()source public
listNested( $dir 'desc' , $nestingKey 'children' )
Returns
Cake\Collection\Iterator\TreeIterator
match()source public
match( array $conditions )
max()source public
max( $callback , $type SORT_NUMERIC )
median()source public
median( $matcher null )
min()source public
min( $callback , $type SORT_NUMERIC )
nest()source public
nest( $idPath , $parentPath , $nestingKey 'children' )
optimizeUnwrap()source protected
optimizeUnwrap( )
Unwraps this iterator and returns the simplest traversable that can be used for getting the data out
Returns
Traversable|arrayreduce()source public
reduce( callable $c , $zero null )
sample()source public
sample( $size 10 )
shuffle()source public
shuffle( )
skip()source public
skip( $howMany )
some()source public
some( callable $c )
sortBy()source public
sortBy( $callback , $dir SORT_DESC , $type SORT_NUMERIC )
sumOf()source public
sumOf( $matcher null )
take()source public
take( $size 1 , $from 0 )
through()source public
through( callable $handler )
toArray()source public
toArray( $preserveKeys true )
toList()source public
toList( )
unfold()source public
unfold( callable $transformer null )
unwrap()source public
unwrap( )
zip()source public
zip( $items )
zipWith()source public
zipWith( $items , $callable )
© 2005–2017 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.
https://api.cakephp.org/3.4/class-Cake.Datasource.ResultSetDecorator.html