Having two related tables, Car and CouponException, I wanna get all cars within an array of models and also get the CouponExceptions related to every Car, but the tricky thing comes here.. i only want to get the CouponException for that car given a coupon id. So what i'm trying now is:
$versions = Doctrine_Query::create()
->from('Car c, c.CouponException ce')
->whereIn('c.model', $models)
->addWhere('ce.coupon_id = ?', $cid)
->fetchArray();
But it only returns to me cars with a coupon exception, and what i want is get all cars in a model list and get the CouponException for that car if there is one with a given Coupon id...