Properties

$_query

$_query : \Cake\ORM\Query

Original query from where results were generated

Type

\Cake\ORM\Query

$_index

$_index : integer

Points to the next record number that should be fetched

Type

integer

$_current

$_current : array

Last record fetched from the statement

Type

array

$_defaultAlias

$_defaultAlias : string

The default table alias

Type

string

$_matchingMap

$_matchingMap : array

List of associations that should be placed under the `_matchingData` result key.

Type

array

$_containMap

$_containMap : array

List of associations that should be eager loaded.

Type

array

$_map

$_map : array

Map of fields that are fetched from the statement with their type and the table they belong to

Type

array

$_matchingMapColumns

$_matchingMapColumns : array

List of matching associations and the column keys to expect from each of them.

Type

array

$_results

$_results : array|\ArrayAccess

Results that have been fetched or hydrated into the results.

Type

array|\ArrayAccess

$_hydrate

$_hydrate : boolean

Whether to hydrate results into objects or not

Type

boolean

$_autoFields

$_autoFields : boolean

Tracks value of $_autoFields property of $query passed to constructor.

Type

boolean

$_entityClass

$_entityClass : string

The fully namespaced name of the class to use for hydrating results

Type

string

$_useBuffering

$_useBuffering : boolean

Whether or not to buffer results fetched from the statement

Type

boolean

$_count

$_count : integer

Holds the count of records in this result set

Type

integer

$_types

$_types : array

Type cache for type converters.

Converters are indexed by alias and column name.

Type

array

$_driver

$_driver : \Cake\Database\Driver

The Database driver object.

Cached in a property to avoid multiple calls to the same function.

Type

\Cake\Database\Driver

Methods

each()

each(callable  $c) 

{@inheritDoc}

Parameters

callable $c

every()

every(callable  $c) 

{@inheritDoc}

Parameters

callable $c

some()

some(callable  $c) 

{@inheritDoc}

Parameters

callable $c

contains()

contains(  $value) 

{@inheritDoc}

Parameters

$value

reduce()

reduce(callable  $c,   $zero = null) 

{@inheritDoc}

Parameters

callable $c
$zero

extract()

extract(  $matcher) 

{@inheritDoc}

Parameters

$matcher

max()

max(  $callback,   $type = \SORT_NUMERIC) 

{@inheritDoc}

Parameters

$callback
$type

min()

min(  $callback,   $type = \SORT_NUMERIC) 

{@inheritDoc}

Parameters

$callback
$type

avg()

avg(  $matcher = null) 

{@inheritDoc}

Parameters

$matcher

median()

median(  $matcher = null) 

{@inheritDoc}

Parameters

$matcher

sortBy()

sortBy(  $callback,   $dir = \SORT_DESC,   $type = \SORT_NUMERIC) 

{@inheritDoc}

Parameters

$callback
$dir
$type

groupBy()

groupBy(  $callback) 

{@inheritDoc}

Parameters

$callback

indexBy()

indexBy(  $callback) 

{@inheritDoc}

Parameters

$callback

countBy()

countBy(  $callback) 

{@inheritDoc}

Parameters

$callback

sumOf()

sumOf(  $matcher = null) 

{@inheritDoc}

Parameters

$matcher

shuffle()

shuffle() 

{@inheritDoc}

sample()

sample(  $size = 10) 

{@inheritDoc}

Parameters

$size

take()

take(  $size = 1,   $from) 

{@inheritDoc}

Parameters

$size
$from

skip()

skip(  $howMany) 

{@inheritDoc}

Parameters

$howMany

match()

match(array  $conditions) 

{@inheritDoc}

Parameters

array $conditions

firstMatch()

firstMatch(array  $conditions) 

{@inheritDoc}

Parameters

array $conditions

first()

first() : array|object

Get the first record from a result set.

This method will also close the underlying statement cursor.

Returns

array|object

last()

last() 

{@inheritDoc}

takeLast()

takeLast(  $howMany) 

{@inheritDoc}

Parameters

$howMany

append()

append(  $items) 

{@inheritDoc}

Parameters

$items

appendItem()

appendItem(  $item,   $key = null) 

{@inheritDoc}

Parameters

$item
$key

prepend()

prepend(  $items) 

{@inheritDoc}

Parameters

$items

prependItem()

prependItem(  $item,   $key = null) 

{@inheritDoc}

Parameters

$item
$key

combine()

combine(  $keyPath,   $valuePath,   $groupPath = null) 

{@inheritDoc}

Parameters

$keyPath
$valuePath
$groupPath

nest()

nest(  $idPath,   $parentPath,   $nestingKey = 'children') 

{@inheritDoc}

Parameters

$idPath
$parentPath
$nestingKey

toArray()

toArray(  $preserveKeys = true) 

{@inheritDoc}

Parameters

$preserveKeys

toList()

toList() 

{@inheritDoc}

jsonSerialize()

jsonSerialize() 

{@inheritDoc}

compile()

compile(  $preserveKeys = true) 

{@inheritDoc}

Parameters

$preserveKeys

lazy()

lazy() 

{@inheritDoc}

listNested()

listNested(  $dir = 'desc',   $nestingKey = 'children') : \Cake\Collection\Iterator\TreeIterator

{@inheritDoc}

Parameters

$dir
$nestingKey

Returns

\Cake\Collection\Iterator\TreeIterator

unfold()

unfold(callable  $transformer = null) 

{@inheritDoc}

Parameters

callable $transformer

through()

through(callable  $handler) 

{@inheritDoc}

Parameters

callable $handler

zip()

zip(  $items) 

{@inheritDoc}

Parameters

$items

zipWith()

zipWith(  $items,   $callable) 

{@inheritDoc}

Parameters

$items
$callable

chunk()

chunk(  $chunkSize) 

{@inheritDoc}

Parameters

$chunkSize

chunkWithKeys()

chunkWithKeys(  $chunkSize,   $preserveKeys = true) 

{@inheritDoc}

Parameters

$chunkSize
$preserveKeys

isEmpty()

isEmpty() 

{@inheritDoc}

unwrap()

unwrap() 

{@inheritDoc}

_unwrap()

_unwrap() 

cartesianProduct()

cartesianProduct(callable|null  $operation = null, callable|null  $filter = null) : \Cake\Collection\CollectionInterface

Parameters

callable|null $operation

Operation

callable|null $filter

Filter

Throws

\LogicException

Returns

\Cake\Collection\CollectionInterface

count()

count() : integer

Gives the number of rows in the result set.

Part of the Countable interface.

Returns

integer

countKeys()

countKeys() : integer

{@inheritDoc}

Returns

integer

__construct()

__construct(\Cake\ORM\Query  $query, \Cake\Database\StatementInterface  $statement) 

Constructor

Parameters

\Cake\ORM\Query $query

Query from where results come

\Cake\Database\StatementInterface $statement

The statement to fetch from

current()

current() : array|object

Returns the current record in the result iterator

Part of Iterator interface.

Returns

array|object

key()

key() : integer

Returns the key of the current record in the iterator

Part of Iterator interface.

Returns

integer

next()

next() : void

Advances the iterator pointer to the next record

Part of Iterator interface.

rewind()

rewind() : void

Rewinds a ResultSet.

Part of Iterator interface.

Throws

\Cake\Database\Exception

valid()

valid() : boolean

Whether there are more results to be fetched from the iterator

Part of Iterator interface.

Returns

boolean

serialize()

serialize() : string

Serializes a resultset.

Part of Serializable interface.

Returns

string —

Serialized object

unserialize()

unserialize(string  $serialized) : void

Unserializes a resultset.

Part of Serializable interface.

Parameters

string $serialized

Serialized object

__debugInfo()

__debugInfo() : array

Returns an array that can be used to describe the internal state of this object.

Returns

array

optimizeUnwrap()

optimizeUnwrap() : \Traversable|array

Unwraps this iterator and returns the simplest traversable that can be used for getting the data out

Returns

\Traversable|array

_calculateAssociationMap()

_calculateAssociationMap(\Cake\ORM\Query  $query) : void

Calculates the list of associations that should get eager loaded when fetching each record

Parameters

\Cake\ORM\Query $query

The query from where to derive the associations

_calculateColumnMap()

_calculateColumnMap(\Cake\ORM\Query  $query) : void

Creates a map of row keys out of the query select clause that can be used to hydrate nested result sets more quickly.

Parameters

\Cake\ORM\Query $query

The query from where to derive the column map

_calculateTypeMap()

_calculateTypeMap() : void

Creates a map of Type converter classes for each of the columns that should be fetched by this object.

_getTypes()

_getTypes(\Cake\ORM\Table  $table, array  $fields) : array

Returns the Type classes for each of the passed fields belonging to the table.

Parameters

\Cake\ORM\Table $table

The table from which to get the schema

array $fields

The fields whitelist to use for fields in the schema.

Returns

array

_fetchResult()

_fetchResult() : mixed

Helper function to fetch the next result from the statement or seeded results.

Returns

mixed

_groupResult()

_groupResult(array  $row) : array

Correctly nests results keys including those coming from associations

Parameters

array $row

Array containing columns and values or false if there is no results

Returns

array —

Results

_castValues()

_castValues(string  $alias, array  $values) : array

Casts all values from a row brought from a table to the correct PHP type.

Parameters

string $alias

The table object alias

array $values

The values to cast

Returns

array