ElementCollection
- Type
- Class
- Namespace
- craft\elements
- Inherits
- craft\elements\ElementCollection »
Illuminate\Support\Collection
- Since
- 4.3.0
ElementCollection represents a collection of elements.
View source (opens new window)
# Public Methods
Method | Description |
---|---|
ids() | Returns a collection of the elements’ IDs. |
one() | |
with() | Eager-loads related elements for the collected elements. |
# ids()
Returns a collection of the elements’ IDs.
View source (opens new window)
Returns
\Illuminate\Support\Collection<\craft\elements\TKey,int>
# one()
View source (opens new window)
Arguments
$callback
$default
Returns
\craft\elements\TValue
–
# with()
Eager-loads related elements for the collected elements.
See Eager-Loading Elements (opens new window) for a full explanation of how to work with this parameter.
View source (opens new window)
Arguments
$with
(array (opens new window), string (opens new window)) – The property value