Thanks so much for any time with this:

Forest->hasMany->Trees
trees->belongsTo->Forest

I want to:
find the forests that only have trees that are brown, (each tree can
only belong to one forest)
list the other trees in those respective forest,
and don't list forests that have no brown trees all from the
forests_controller.

Obviously I can't use the $conditions[trees][treecolor] = 'brown' in
the findAll method as hasMany doesn't seem to be a true joing.

I've unsuccesfully tried Bind/Unbind in the Forest Controller, setting
the conditions -> 'trees.treecolor = brown' while still using hasMany.
However, this still returns ALL forests but hides the associated data
that doesn't meet the condition.

I'm thinking maybe switching this relationship to HABTM using the
hasOne/belongsTo on a join table trick, but that seems like overkill
as each tree can only belong to one forest even though multiple trees
may be brown.

.......would the best way to do this be a HABTM table in a quick bind/
unbind in the controller?

Any help would be great.

Thanks,
Beau


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to