Help with hasAndBelongsToMany Association Between Two Models - Team and Game

2007-06-06 Thread Wole
Hi. First, can anybody recommend a few Websites that explain CakePHP associations and provide tutorials and examples? I have read the manual and a couple other Websites, but I am still having problems understanding the concepts. Second, I need help with figuring out the association between two

Re: Help with hasAndBelongsToMany Association Between Two Models - Team and Game

2007-06-06 Thread Chris Hartjes
On 6/6/07, Wole [EMAIL PROTECTED] wrote: Second, I need help with figuring out the association between two models, Team and Game. They are part of a basketball league Website I am building. I believe the appropriate association between the models is hasAndBelongsToMany, but I could be

Re: Help with hasAndBelongsToMany Association Between Two Models - Team and Game

2007-06-06 Thread Wole
Chris, Thanks for your response. Can you please explain a little more? My games database has two columns, home and visitor, that specify the names of the teams that played the game. To do a Game belongsTo Team association I need one foreignKey but in this case I have two possible foreignKeys,

Re: Help with hasAndBelongsToMany Association Between Two Models - Team and Game

2007-06-06 Thread Joshua Benner
Wole, Understanding the differences between the relation types can be a little difficult at first. I still struggle with remembering, because it can make sense semantically either way! :) My rule of thumb is this: - If a table record "has" another record, the foreign record points to this