I'm trying to eager-load a Matrix field with it's blocktype and related field types. For some reason the _eagerLoadedBlockTypeElements are empty arrays.
If I get rid of the
with clause on ElementCriteria and iterate through the items it does work, which is not surprising.
The code I have right now (including dumping the results) are below.
$criteria = craft()->elements->getCriteria(ElementType::GlobalSet, [ 'handle' => 'footer', 'with' => ['column1Items.item:itemSection', 'column1Items.item:itemTitle'] ]); $found = $criteria->first(); dump($found->getEagerLoadedElements('column1Items')); exit();
I'm fairly new to Craft and working with Yii hopefully someone can help me out with this one!
P.S. I can dump the query logs if necessary, just shoot!