Skip to content

EagerLoad

Represents a level in the relations tree to be eagerly loaded


  • Full name: \PhalconKit\Mvc\Model\EagerLoading\EagerLoad
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Properties

relation

private \Phalcon\Mvc\Model\RelationInterface $relation

constraints

private null|callable $constraints

parent

private \PhalconKit\Mvc\Model\EagerLoading\Loader|\PhalconKit\Mvc\Model\EagerLoading\EagerLoad $parent

subject

private null|\Phalcon\Mvc\ModelInterface[] $subject

Methods

__construct

public __construct(\Phalcon\Mvc\Model\Relation $relation, null|callable $constraints, \PhalconKit\Mvc\Model\EagerLoading\Loader|\PhalconKit\Mvc\Model\EagerLoading\EagerLoad $parent): mixed

Parameters:

Parameter Type Description
$relation \Phalcon\Mvc\Model\Relation
$constraints null|callable
$parent \PhalconKit\Mvc\Model\EagerLoading\Loader|\PhalconKit\Mvc\Model\EagerLoading\EagerLoad

getSubject

public getSubject(): null|\Phalcon\Mvc\ModelInterface[]

load

Executes each db query needed

public load(): $this

Note: The {$alias} property is set two times because Phalcon Model ignores empty arrays when overloading property set.

Also

  • See: https://github.com/stibiumz/phalcon.eager-loading/issues/1