Represents the results obtained after executing a query for a specific table This object is responsible for correctly nesting result keys reported from the query, casting each field to the correct type and executing the extra queries required for eager loading external associations.
$_autoFields
protected boolean
$_containMap
protected array
$_count
protected integer
$_current
protected array
$_defaultAlias
protected string
$_defaultTable
protected $_driver
protected $_entityClass
protected string
$_hydrate
protected boolean
$_index
protected integer
$_map
protected array
Map of fields that are fetched from the statement with their type and the table they belong to
$_matchingMap
protected array
List of associations that should be placed under the _matchingData
result key.
$_matchingMapColumns
protected array
List of matching associations and the column keys to expect from each of them.
$_query
protected $_results
protected array|ArrayAccess
$_statement
protected $_types
protected array
$_useBuffering
protected boolean
Returns an array that can be used to describe the internal state of this object.
Calculates the list of associations that should get eager loaded when fetching each record
Creates a map of row keys out of the query select clause that can be used to hydrate nested result sets more quickly.
Creates a map of Type converter classes for each of the columns that should be fetched by this object.
Casts all values from a row brought from a table to the correct PHP type.
Helper function to fetch the next result from the statement or seeded results.
Returns the Type classes for each of the passed fields belonging to the table.
__construct( Cake\ORM\Query $query , Cake\Database\StatementInterface $statement )
Constructor
Cake\ORM\Query
$query
Cake\Database\StatementInterface
$statement
__debugInfo( )
Returns an array that can be used to describe the internal state of this object.
_calculateAssociationMap( Cake\ORM\Query $query )
Calculates the list of associations that should get eager loaded when fetching each record
Cake\ORM\Query
$query
_calculateColumnMap( Cake\ORM\Query $query )
Creates a map of row keys out of the query select clause that can be used to hydrate nested result sets more quickly.
Cake\ORM\Query
$query
_calculateTypeMap( )
Creates a map of Type converter classes for each of the columns that should be fetched by this object.
_castValues( string $alias , array $values )
Casts all values from a row brought from a table to the correct PHP type.
$alias
$values
_fetchResult( )
Helper function to fetch the next result from the statement or seeded results.
_getTypes( Cake\ORM\Table $table , array $fields )
Returns the Type classes for each of the passed fields belonging to the table.
Cake\ORM\Table
$table
$fields
_groupResult( mixed $row )
Correctly nests results keys including those coming from associations
$row
count( )
Gives the number of rows in the result set.
Part of the Countable interface.
Countable::count()
current( )
Returns the current record in the result iterator
Part of Iterator interface.
Iterator::current()
first( )
Get the first record from a result set.
This method will also close the underlying statement cursor.
Cake\Collection\CollectionInterface::first()
key( )
Returns the key of the current record in the iterator
Part of Iterator interface.
Iterator::key()
next( )
Advances the iterator pointer to the next record
Part of Iterator interface.
Iterator::next()
rewind( )
Rewinds a ResultSet.
Part of Iterator interface.
Cake\Database\Exception
Iterator::rewind()
serialize( )
Serializes a resultset.
Part of Serializable interface.
Serializable::serialize()
unserialize( string $serialized )
Unserializes a resultset.
Part of Serializable interface.
$serialized
Serializable::unserialize()
valid( )
Whether there are more results to be fetched from the iterator
Part of Iterator interface.
Iterator::valid()
_unwrap( )
append( $items )
cartesianProduct( callable $operation null , callable $filter null )
Cake\Collection\CollectionInterface
chunk( $chunkSize )
chunkWithKeys( $chunkSize , $preserveKeys true )
combine( $keyPath , $valuePath , $groupPath null )
compile( $preserveKeys true )
contains( $value )
countBy( $callback )
each( callable $c )
every( callable $c )
extract( $matcher )
firstMatch( array $conditions )
groupBy( $callback )
indexBy( $callback )
isEmpty( )
jsonSerialize( )
last( )
listNested( $dir 'desc' , $nestingKey 'children' )
Cake\Collection\Iterator\TreeIterator
match( array $conditions )
max( $callback , $type SORT_NUMERIC )
min( $callback , $type SORT_NUMERIC )
nest( $idPath , $parentPath , $nestingKey 'children' )
reduce( callable $c , $zero null )
sample( $size 10 )
shuffle( )
skip( $howMany )
some( callable $c )
sortBy( $callback , $dir SORT_DESC , $type SORT_NUMERIC )
sumOf( $matcher null )
take( $size 1 , $from 0 )
through( callable $handler )
toArray( $preserveKeys true )
toList( )
unfold( callable $transformer null )
unwrap( )
zip( $items )
zipWith( $items , $callable )
protected boolean
Tracks value of $_autoFields property of $query passed to constructor.
protected Cake\Database\Driver
The Database driver object.
Cached in a property to avoid multiple calls to the same function.
protected string
The fully namespaced name of the class to use for hydrating results
protected array
Map of fields that are fetched from the statement with their type and the table they belong to
[]
protected array
List of associations that should be placed under the _matchingData
result key.
[]
protected array
List of matching associations and the column keys to expect from each of them.
[]
protected Cake\ORM\Query
Original query from where results were generated
protected array|ArrayAccess
Results that have been fetched or hydrated into the results.
[]
protected array
Type cache for type converters.
Converters are indexed by alias and column name.
[]
protected boolean
Whether or not to buffer results fetched from the statement
true
© 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.ORM.ResultSet.html