Eager Loading Image Transforms In Plugin The craft docs on eager loading show you how to eager load image transforms in twig. 

{% set entries = craft.entries({
   with: [
        ['coolImage', { withTransforms: ['transform'] }]
    ]
}) %}


However I can't figure out the syntax for achieving the same functionality within a plugin using the ElementCritereaModel.

I've made various attempts but they've all resulted in HUGE EXPLOSIONS of the php error variety.

$criterea-&gt;with = [
    "coolImage" =&gt; [
        "withTransforms" =&gt; ["transform"]
    ],
    "otherAssetField",
    "someCategoryField"
];


Of course above wouldn't work because you're switching between field slugs being keys/values in the array.

Using a similar syntax to the docs in twig would be:

$criterea-&gt;with = [
    "teaserImage",
    ["withTransforms" =&gt; ["peopleListing"]],
    "peoplePffice",
    "peopleCategories"
];


But that also results in explosions.

Help!!! (thanks)
I came across this post while searching for the same answer. Figured it out eventually. For future reference, the correct syntax in a (Craft 2) plugin would be:

$criterea-&gt;with = [
    ["coolImage", ["withTransforms" =&gt; ["transform"]]],
    "otherAssetField",
    "someCategoryField"
];