On Jan 16, 2007, at 3:45 PM, jyrgen wrote:
hi all,
my app has basically 3 models:
users (actually "web"users), authors and publishers.
authors and publishers are both able to log into the app and do
things,
regard them as different usergroups.
every author and every publisher has webuser data.
so how should i layout the associations :
1)
user -> hasMany author (condition group=A)
user -> hasMany publisher (condition group=P)
author -> belongsTo user
publisher -> belongsTo user
If the tables have author.user_id and publisher.user_id, yeah.
or like this :
2)
user -> belongsTo author (condition group=A)
user -> belongsTo publisher (condition group=P)
author -> hasOne user
publisher -> hasOne user
If the tables have user.author_id and user.publisher_id, yeah.
i just don't get the clue ...
It mostly has to do with the way the keying of the tables are, and
how you most often want the data.
-- John
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---