From 44e775dfe7b4101d6cea39051adba7795d340cbe Mon Sep 17 00:00:00 2001 From: Tom Davies Date: Thu, 26 Sep 2024 13:56:30 +0100 Subject: [PATCH] Fix method signatures in Element::setEagerLoadedElements() example --- docs/5.x/extend/element-types.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/5.x/extend/element-types.md b/docs/5.x/extend/element-types.md index 6c5ea9a03..d74dee0ce 100644 --- a/docs/5.x/extend/element-types.md +++ b/docs/5.x/extend/element-types.md @@ -1151,14 +1151,14 @@ You may be able to create the source-target map without another database query, If you need to override where eager-loaded elements are stored, add a `setEagerLoadedElements()` method to your element class as well: ```php -public function setEagerLoadedElements(string $handle, array $elements): void +public function setEagerLoadedElements(string $handle, array $elements, EagerLoadPlan $plan): void { // The handle can be anything, so long as it matches what is used in `eagerLoadingMap()`: if ($handle === 'author') { $author = $elements[0] ?? null; $this->setAuthor($author); } else { - parent::setEagerLoadedElements($handle, $elements); + parent::setEagerLoadedElements($handle, $elements, $plan); } } ```