Re: hasAndBelongsToMany vs hasMany BelongsTo..... (long and boring)
On 4/6/06, zis [EMAIL PROTECTED] wrote: Gustavo, lol. you win the most perseverant reader award. Thanks !! Could you fax it to my inbox ? ;) -- If you know Red Hat you know Red Hat, If you know Slackware you know Linux --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: hasAndBelongsToMany vs hasMany BelongsTo..... (long and boring)
You certainly could, that makes perfect sense. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
hasAndBelongsToMany vs hasMany BelongsTo..... (long and boring)
Hi, I am currenlty building a directory with cake and have a fairly complex architecture. I'dd like to have your opinion for the best model setup. Here are two of my tables: venues: is the table who holds the list of venues and has the following fields: id, name, description areas: holds the list of different geographical areas.. and has the following fields: id, name for example, a venue could be McDonalds. and areas could be, downtown, old part, business district... Now, each venue could be in many areas (a McDonalds in downtown and business dist..).. but also each district can have many venues in it (there could be a mcdonalds and a Burger King in downtown). Anyone still following? the logical was of linking them is doing a link table with venue_id and area_id.. and put a $hasAndBelongsToMany in both venues and areas models. The problem is: the downtown mcdonalds could have a drive through but the business district doesnt.. or a non smoking area. .or offers breakfast.. or whatever.. the point is, each venue/area combination has unique settings.. to solve this i evolved the link table into a more elaborate one with the following fields: id, venue_id, area_id, smoking, parking, drivethrough... basically, the link ids and the option fields.. Now the tricky part (If someone is still following, WOW). I created a model and controller for the new table i called details. The question is, should the venues and areas models still have $hasAndBelongsToMany = ;details'? or should venues and areas should have a $hasMany = 'details' and the details model have $belongsTo areas and venues If anyone understood anything and has an answer... thanks.. really. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: hasAndBelongsToMany vs hasMany BelongsTo..... (long and boring)
Thanks AD7six. Nate's reply is exactly the answer i was looking for.. i guess i must have tried searching.. Oh.. and i didn't expect anyone to read the whole post.. i couldn't even read it to check for mistakes ;) zis --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: hasAndBelongsToMany vs hasMany BelongsTo..... (long and boring)
On 4/5/06, zis [EMAIL PROTECTED] wrote: Oh.. and i didn't expect anyone to read the whole post.. i couldn't even read it to check for mistakes ;) If there is a prize on reading the whole post, where do I claim it ? ;-) -- If you know Red Hat you know Red Hat, If you know Slackware you know Linux --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---