Yes, the GROUP (group_id) is the same as the ROLE when each user can
only play one role (group)!

So your user model should state that a user HasOne GROUP
Your group model should state that a group HasMany USERs

So when a user with group Seller is selling items with an ad, the ad
must be related to the user, not the group!

Your ad model should state that an ad HasOne SELLER.
Your seller (user) model should state that a seller HasMany ADs

The reason I am using a seller model, is that I then relieve the user
model from taking care of the ad relationship, but it is up to you,
how you like to model your tables.

Hope this helps you on the way :)
   John,



On Mar 19, 5:13 pm, "Dave Maharaj :: WidePixels.com"
<d...@widepixels.com> wrote:
> Thanks for your info.
>
> Just wondering because instead of ROLE I have group_id in the USER table so
> each user is either a 1 2 or 3 (MANAGER, BUYER or SELLER) is that not the
> same thing?
>
[snip]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to