Cake doesn't recursively fetch related model "UnitI18n" if model "Unit" has only one field - ID
On May 14, 9:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > what's the point of a table with only an ID field? > > OnMay14, 2:02 pm, senser <[EMAIL PROTECTED]> wrote: > > > Hi Bakers :). > > > I already wrote about my problem > > here:http://groups.google.com/group/cake-php/browse_thread/thread/bab2d3ac... > > but decided to start new discussion because accidentally found an > > interesting moment. > > > Let me explain: > > I have 5 models - Offer, Unit, UnitI18n, Category & CategoryI18n. They > > are related as follows: > > > Offer--belongsTo-->Category > > Offer--belongsTo-->Unit > > Category--hasMany-->CategoryI18n > > Unit--hasMany-->UnitI18n > > > So the problem is that when I run $this->Offer->findAll(array(), > > array(), 'Offer.last_edit_date DESC',1, 1, 2) the resulted area > > contains records from CategoryI18n, but not UnitI18n. > > > The new (andmaybe strange moment) is that the table for Category > >modelconsists from TWO columns - "id" (primary key) and > > "category_id", but units table formodelUnit contains only ONE > > column- "id" (the primary key). If I add another one column in units > > table - "last-edit_date" for example, and then Cake receives necessary > > records from UnitI18nmodel, so the problem is "solved". > > > Actually I don't need field "last_edit_date" in units table, so I'm > > wondering is there any other solution and where is the reason for such > > "Cake behavior" --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
