[eluser]OverZealous[/eluser]
[quote author="squawk" date="1278710274"]OverZealous, could you have a look at this? (Full code in previous post) I am having trouble getting the included join field. Does include_join_field work with where_in_related?
Code:
$p = new Place();
$p->include_join_fields();
$p->where_in_related('buyer', 'id', $buyer_ids);
$p->get_iterated();
[/quote]
DMZ should work just fine in that exact example. Basically, calling include_join_fields sets a flag. When you next add a related object, all the fields on the join table between those objects are added to the select statement.
The method for joining a related table is shared - so there's only one place for it to occur.
Now, there is one possibility, and that is if the object was already joined previously in the query, it might not get that far in the method. I don't have easy access to the source right now.
Anyway, you can save yourself a lot of time by looking at the generated query. The troubleshooting page tells you how. Maybe you are looking for the wrong field name(s)?