ActiveRecord Question

I’m pulling data from a couple joined tables which is easy enough with model()->with, but for each row I need to pull from another table. For example I’m selecting all “listings” and then I need to get all “images” for each “listing”. What is the best way to do that? So far I have this:

$lisitngs = Listings::model()->with(‘community_listing_maps’)->findAll($criteria);

But can I pull the images within this or do I need another query?

try




$lisitngs = Listings::model()->with(array('community_listing_maps', 'images'))->findAll($criteria);