public function eagerLoadElements($elements, $with)
    {
        // Bail if there aren't even any elements
        if (empty($elements)) {
            return;
        }

        if (!\is_array($elements)) {
            $elements = [$elements];
        }
        // We are assuming all of these elements are of the same type
        /** @var Element $element */
        $element = $elements[0];
        $elementType = \get_class($element);
        Craft::$app->elements->eagerLoadElements($elementType, $elements, $with);
    }
public function eagerLoadElements($elements, $with)
    {
        // Bail if there aren't even any elements
        if (empty($elements)) {
            return;
        }

        if (!\is_array($elements)) {
            $elements = [$elements];
        }
        // We are assuming all of these elements are of the same type
        /** @var Element $element */
        $element = $elements[0];
        $elementType = \get_class($element);
        Craft::$app->elements->eagerLoadElements($elementType, $elements, $with);
    }
public function eagerLoadElements ( $ elements , $ with ) { // Bail if there aren't even any elements if ( empty ( $ elements ) ) { return ; } if ( ! \ is_array ( $ elements ) ) { $ elements = [ $ elements ] ; } // We are assuming all of these elements are of the same type /** @var Element $element */ $ element = $ elements [ 0 ] ; $ elementType = \ get_class ( $ element ) ; Craft :: $ app -> elements -> eagerLoadElements ( $ elementType , $ elements , $ with ) ; }
Eager-loads additional elements onto a given set of elements.

@param ElementInterface[] $elements The root element models that should
be updated with the eager-loaded
elements
@param string|array       $with     Dot-delimited paths of the elements
that should be eager-loaded into the
root elements

@return void
Eager - loads additional elements onto a given set of elements .