This is a frequent topic, retrieving data from models over several levels of association.
The current answers nearly always are: 1) Look into using the Containable behavior, see: http://book.cakephp.org/view/1323/Containable 2) Look into using joins, see: http://book.cakephp.org/view/1047/Joining-tables The above should make it possible for you to avoid the additional queries. Enjoy, John On Jun 8, 1:10 pm, pinker42 <[email protected]> wrote: > Hi, > > i urgently need some help with a really nasty problem. > > I have 4 main tables A,B,C,D and two join tables AB, BC joined: A (1 > record) -> (HABTM AB) B (13 records) -> (HABTM BC) C (131 records) -> > (hasMany) D (405 records). When i fetch the data with A->find('All') > cake does a good job for A,B and C. But than repeats the Query for D > 13 times (number of records for B !). > The result set is okay, but the performance is really sad, because the > result set for D is quite Huge. Is it not possible to handle > MODEL->HABTM->HABTM->HasMany releationships with simple model binds in > > Cake ? > > Best regards and thanks in advance > > Dirk Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" 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
