first off, it seems like the page would probably run faster if it was just one query instead of 30 or 40.
but the other reason is to filter results or get variables from the other model. for instance, if Forrest has many Trees and i query Forrest wanting to only return Trees that are Brown, how is it possible to check if Trees.Brown from the query on Forrest if it is not joined? *v On Dec 20, 3:52 pm, "Adrian Godong" <[EMAIL PROTECTED]> wrote:
I think it has something to do with the result parser. It's not a bug, it's by design. Other association that does join tables are belongsTo. Why do you need it in one query? -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 21 Desember 2006 4:11 To: Cake PHP Subject: does cake not join tables when using hasMany? i had some strange results today when working w/ associations in cake. from what i can tell, defining an association as hasMany, does not result in a table join query. instead, it queries the first table, and then queries the second table once for each result in the first table. when i changed the association to hasOne, it performed the query properly and did a join, but the result was not formatted as it should be. has anyone run into this problem? i can provide some sample code and examples if needed...
--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
