Is it possible for a custom Element Type to eager load Records instead of Elements? #12171
-
I'm working on a project that has a custom Element Type, that has a It's for a custom quoting system. The Quote is a Custom Element and each quote can have many LineItems (which are Active Records). I've read the docs on eager loading Element Types and it seems to imply that only other Element types can be eager loaded with Is that a correct assessment? Or are there other ways to eager load "non Elements" that are related to a custom Element Type? Edit: Actually... while digging around the discussions, I think I might have answered my question. Seems like Figured it might still be worthwhile to post in case other folks have a similar question or there's a better way to approach this. Related Discussion: Example in Craft Commerce |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The built-in element eager-loading support is limited to elements and we don’t have any plans to change that. You’ll have to do something similar to Commerce orders, as you’ve found. |
Beta Was this translation helpful? Give feedback.
The built-in element eager-loading support is limited to elements and we don’t have any plans to change that. You’ll have to do something similar to Commerce orders, as you’ve found.