CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.6 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.6
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
      • Association
      • Behavior
      • Exception
      • Locator
      • Rule
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class LazyEagerLoader

Contains methods that are capable of injecting eagerly loaded associations into entities or lists of entities by using the same syntax as the EagerLoader.

Namespace: Cake\ORM

Method Summary

  • _getPropertyMap() protected

    Returns a map of property names where the association results should be injected in the top level entities.

  • _getQuery() protected

    Builds a query for loading the passed list of entity objects along with the associations specified in $contain.

  • _injectResults() protected

    Injects the results of the eager loader query into the original list of entities.

  • loadInto() public

    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.

Method Detail

_getPropertyMap() ¶ protected

_getPropertyMap(Cake\ORM\Table $source, array $associations): array

Returns a map of property names where the association results should be injected in the top level entities.

Parameters
Cake\ORM\Table $source

The table having the top level associations

array $associations

The name of the top level associations

Returns
array

_getQuery() ¶ protected

_getQuery(Cake\Collection\CollectionInterface $objects, array $contain, Cake\ORM\Table $source): Cake\ORM\Query

Builds a query for loading the passed list of entity objects along with the associations specified in $contain.

Parameters
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

Returns
Cake\ORM\Query

_injectResults() ¶ protected

_injectResults(array|Traversable $objects, Cake\Collection\CollectionInterface|Cake\Database\Query $results, array $associations, Cake\ORM\Table $source): array

Injects the results of the eager loader query into the original list of entities.

Parameters
array|Traversable $objects

The original list of entities

Cake\Collection\CollectionInterface|Cake\Database\Query $results

The loaded results

array $associations

The top level associations that were loaded

Cake\ORM\Table $source

The table where the entities came from

Returns
array

loadInto() ¶ public

loadInto(Cake\Datasource\EntityInterface|array $entities, array $contain, Cake\ORM\Table $source): Cake\Datasource\EntityInterface|array

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.

Parameters
Cake\Datasource\EntityInterface|array $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

Returns
Cake\Datasource\EntityInterface|array
See Also
\Cake\ORM\Query::contain()
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs