EagerLoadPlan
- Type
- Class
- Namespace
- craft\elements\db
- Inherits
- craft\elements\db\EagerLoadPlan » yii\base\BaseObject (opens new window)
- Implements
- yii\base\Configurable (opens new window)
- Since
- 3.5.0
Class EagerLoadPlan
View source (opens new window)
# Public Properties
Property | Description |
---|---|
alias | string (opens new window), null (opens new window) – The eager-loading alias |
all | boolean (opens new window) – Whether to eager-load the matching elements |
count | boolean (opens new window) – Whether to eager-load the count of the matching elements |
criteria | array (opens new window) – The criteria that should be applied when eager-loading these elements |
handle | string (opens new window), null (opens new window) – The eager-loading handle |
nested | craft\elements\db\EagerLoadPlan[] – Nested eager-loading plans to apply to the eager-loaded elements. |
when | callable (opens new window), null (opens new window) – A PHP callable whose return value determines whether to apply eager-loaded elements to the given element. |
# alias
- Type
- string (opens new window), null (opens new window)
- Default value
null
The eager-loading alias
View source (opens new window)
# all
- Type
- boolean (opens new window)
- Default value
false
- Since
- 3.5.12
Whether to eager-load the matching elements
View source (opens new window)
# count
- Type
- boolean (opens new window)
- Default value
false
Whether to eager-load the count of the matching elements
View source (opens new window)
# criteria
- Type
- array (opens new window)
- Default value
[]
The criteria that should be applied when eager-loading these elements
View source (opens new window)
# handle
- Type
- string (opens new window), null (opens new window)
- Default value
null
The eager-loading handle
View source (opens new window)
# nested
- Type
- craft\elements\db\EagerLoadPlan[]
- Default value
[]
Nested eager-loading plans to apply to the eager-loaded elements.
View source (opens new window)
# when
- Type
- callable (opens new window), null (opens new window)
- 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 (opens new window)
# Public Methods
Method | Description |
---|---|
__call() (opens new window) | Calls the named method which is not a class method. |
__construct() (opens new window) | Constructor. |
__get() (opens new window) | Returns the value of an object property. |
__isset() (opens new window) | Checks if a property is set, i.e. defined and not null. |
__set() (opens new window) | Sets value of an object property. |
__unset() (opens new window) | Sets an object property to null. |
canGetProperty() (opens new window) | Returns a value indicating whether a property can be read. |
canSetProperty() (opens new window) | Returns a value indicating whether a property can be set. |
className() (opens new window) | Returns the fully qualified name of this class. |
hasMethod() (opens new window) | Returns a value indicating whether a method is defined. |
hasProperty() (opens new window) | Returns a value indicating whether a property is defined. |
init() (opens new window) | Initializes the object. |