Is there any way to "eagerly load" Craft element relations a la Yii's ActiveRelation "with" function?
http://www.yiiframework.com/doc/api/1.1/CActiveRecord#with-detail
This seems like a very handy way to request one big query instead of many small ones in cases where you know up front that you are going to be using all the relations.
** UPDATE **
Okay after experimenting with this, I guess my real question should have been, is there any way to do this kind of thing at the ElementCriteriaModel level, taking advantage of Craft relational fields.
For instance, I want to get a list of children of a Structure entry, along with all the assets in a field:
foreach ($entry->children->find() as $child) {
// do something with $child->assetsField...
}
Is there any way to load those assets in one big query rather than individually for each child?