Class ResultSetFactory
Factory class for generation ResulSet instances.
It is responsible for correctly nesting result keys reported from the query and hydrating entities.
Namespace: Cake\ORM
Method Summary
-
collectData() protected
Get repository and it's associations data for nesting results key and entity hydration.
-
createResultSet() public
Constructor
-
groupResult() protected
Correctly nests results keys including those coming from associations.
Method Detail
collectData() ¶ protected
collectData(Cake\ORM\Query\SelectQuery $query): array
Get repository and it's associations data for nesting results key and entity hydration.
Parameters
-
Cake\ORM\Query\SelectQuery
$query The query from where to derive the data.
Returns
array
createResultSet() ¶ public
createResultSet(Cake\ORM\Query\SelectQuery<T> $query, array $results): Cake\ORM\ResultSet<arrayCake\Datasource\EntityInterface>
Constructor
Parameters
-
Cake\ORM\Query\SelectQuery<T>
$query Query from where results came.
-
array
$results Results array.
Returns
Cake\ORM\ResultSet<arrayCake\Datasource\EntityInterface>
groupResult() ¶ protected
groupResult(array $row, array $data): Cake\Datasource\EntityInterface|array
Correctly nests results keys including those coming from associations.
Hydrate row array into entity if hydration is enabled.
Parameters
-
array
$row Array containing columns and values.
-
array
$data Array containing table and query metadata
Returns
Cake\Datasource\EntityInterface|array