@R. Rajesh Jeba Anbiah - thanks for this direction. It;s very useful, nut I still can't figure out my wonder.
Let's say we have two tables (models) - "A" & "B" with associations: "A" hasMany "B" "B" belongsTo "A" And we are searching with criteria for table "A" (for example "A.id >5"). If we search through model "A" with something like "$this->A- >findAll($query, null, null, null, null, 2)" Cake doesn't recursively find records in model B (doesn't make JOIN). If try to search through model "B" Cake makes LEFT JOIN but it's not decision because it's possble record in table "A" to not have an associated record in table "B" On Nov 10, 7:22 pm, "R. Rajesh Jeba Anbiah" <[EMAIL PROTECTED]> wrote: > On Nov 9, 4:57 pm, senser <[EMAIL PROTECTED]> wrote: > > > I have a big wonder about implementing a simple search form in my > > CakePHP application. > > Let's say we have 4 related tables (models): countries(id, name), > > customers(id, first_name, surname), years(id, year) and > > customer_years(id, year_id, customer_id, data). > > They have associations: > > > customers *belongsTo* countries (aka countries *hasMany* customers) > > > customers *hasMany* customer_years (aka customer_years *belongsTo* > > customers) > > > years *hasMany* customer_years (aka customer_years *belongsTo* years) > > <snip> > > My personal understanding is that you don't need to fiddle with the > join table (no need to create model for join table and no need to > define association for that model). *I might be wrong though* > > For search related > discussionshttp://groups.google.com/group/cake-php/web/frequent-discussions > > -- > <?php echo 'Just another PHP saint'; ?> > Email: rrjanbiah-at-Y!com Blog:http://rajeshanbiah.blogspot.com/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
