Contains methods that are capable of injecting eagerly loaded associations into entities or lists of entities by using the same syntax as the EagerLoader.
Returns a map of property names where the association results should be injected in the top level entities.
Builds a query for loading the passed list of entity objects along with the associations specified in $contain.
Injects the results of the eager loader query into the original list of entities.
Loads the specified associations in the passed entity or list of entities by executing extra queries in the database and merging the results in the appropriate properties.
_getPropertyMap(\Cake\ORM\Table $source, array $associations)
Returns a map of property names where the association results should be injected in the top level entities.
\Cake\ORM\Table
$source The table having the top level associations
string[]
$associations The name of the top level associations
string[]
_getQuery(\Cake\Collection\CollectionInterface $objects, array $contain, \Cake\ORM\Table $source)
Builds a query for loading the passed list of entity objects along with the associations specified in $contain.
\Cake\Collection\CollectionInterface
$objects The original entities
array
$contain The associations to be loaded
\Cake\ORM\Table
$source The table to use for fetching the top level entities
\Cake\ORM\Query
_injectResults(iterable $objects, mixed $results, array $associations, \Cake\ORM\Table $source)
Injects the results of the eager loader query into the original list of entities.
\Cake\Datasource\EntityInterface[]|\Traversable
$objects The original list of entities
\Cake\Collection\CollectionInterface|\Cake\ORM\Query
$results The loaded results
string[]
$associations The top level associations that were loaded
\Cake\ORM\Table
$source The table where the entities came from
array
loadInto(mixed $entities, array $contain, \Cake\ORM\Table $source)
Loads the specified associations in the passed entity or list of entities by executing extra queries in the database and merging the results in the appropriate properties.
The properties for the associations to be loaded will be overwritten on each entity.
\Cake\Datasource\EntityInterface|\Cake\Datasource\EntityInterface[]
$entities a single entity or list of entities
array
$contain A contain()
compatible array.
\Cake\ORM\Table
$source The table to use for fetching the top level entities
\Cake\Datasource\EntityInterface|\Cake\Datasource\EntityInterface[]
© 2005–present 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/4.1/class-Cake.ORM.LazyEagerLoader.html