You can do some nice JOINs, so in the above example we can grab the image, product name and group name:

// -------------------------------------------------
// an example with 2 joins
// get all the images linked with products or productgroups
// and the product name and group name.
$i = new DataObject_Image();
$pi = new DataObject_Product_image();
$pgi = new DataObject_Productgroup_image();
$i->joinAdd($pi);
$i->joinAdd($pgi);

This assumes that Items has two foreign keys, both to status (fk_status and fk_minor_status)

I have used 'LEFT' joins because no all items will have a status (it is null) but we still want to list that item.

Don't forget: DB_DataObject::debugLevel(1); is your best friend ever, please invite him to the party and make sure he has a drink.

I hope this helps someone out. I think these type of JOINs are a basic part of SQL, so it's nice to see them included in DB_DataObject. I have logged this a documentation bug, so I hope this may be fixed one day...