Skip to content

EagerLoadPlan ​

Type
Class
Namespace
craft\elements\db
Inherits
craft\elements\db\EagerLoadPlan » yii\base\BaseObject
Implements
yii\base\Configurable
Since
3.5.0

Class EagerLoadPlan

View source

Public Properties ​

PropertyDescription
aliasstring, null – The eager-loading alias
allboolean – Whether to eager-load the matching elements
countboolean – Whether to eager-load the count of the matching elements
criteriaarray – The criteria that should be applied when eager-loading these elements
handlestring, null – The eager-loading handle
nestedcraft\elements\db\EagerLoadPlan[] – Nested eager-loading plans to apply to the eager-loaded elements.
whencallable, null – A PHP callable whose return value determines whether to apply eager-loaded elements to the given element.

alias ​

Type
string, null
Default value
null

The eager-loading alias

View source

all ​

Type
boolean
Default value
false
Since
3.5.12

Whether to eager-load the matching elements

View source

count ​

Type
boolean
Default value
false

Whether to eager-load the count of the matching elements

View source

criteria ​

Type
array
Default value
[]

The criteria that should be applied when eager-loading these elements

View source

handle ​

Type
string, null
Default value
null

The eager-loading handle

View source

nested ​

Type
craft\elements\db\EagerLoadPlan[]
Default value
[]

Nested eager-loading plans to apply to the eager-loaded elements.

View source

when ​

Type
callable, null
Default value
null
Since
3.5.12

A PHP callable whose return value determines whether to apply eager-loaded elements to the given element.

The signature of the callable should be function (\craft\base\ElementInterface $element): bool, where $element refers to the element the eager-loaded elements are about to be applied to. The callable should return a boolean value.

View source

Public Methods ​

MethodDescription
__call()Calls the named method which is not a class method.
__construct()Constructor.
__get()Returns the value of an object property.
__isset()Checks if a property is set, i.e. defined and not null.
__set()Sets value of an object property.
__unset()Sets an object property to null.
canGetProperty()Returns a value indicating whether a property can be read.
canSetProperty()Returns a value indicating whether a property can be set.
className()Returns the fully qualified name of this class.
hasMethod()Returns a value indicating whether a method is defined.
hasProperty()Returns a value indicating whether a property is defined.
init()Initializes the object.