http://cakephp.1045679.n5.nabble.com/model-for-different-role-users-td132610
6.html
How do you set up the "foreign_key" for example
Seller has id: 5 user_id: 15 so User model would be seller but foreign_key?
Id => 15?
Thanks
Dave
-----Original Message-----
From: cricket [mailto:zijn.digital@gmail.com]
Sent: November-25-10 2:36 PM
To: cake-php@googlegroups.com
Subject: Re: Table / Role / Profile Relations
You could use separate models: Administrator, Buyer, and Seller. Plus
have a User model to handle logins. So users has columns:
email
password
model
foreign_key
In your login() do a switch on $this->Auth->user('model') to decide
where to redirect to.
On Thu, Nov 25, 2010 at 10:00 AM, Dave Maharaj <me@davemaharaj.com> wrote:
> Advise needed.
>
>
>
> I have a new site that has 3 roles. 1 admin and 2 other make it easy call
it
> buyer and seller
>
>
>
> Now admin needs no profile only 1 admin in this case…like I said lets keep
> it simple. Now seller has a profile with lots of relations hasmany this
and
> that HABTM other things. Where the buyer has only 1 or 2 hasMany. How
could
> it be set up so depending on the Users role have a buyer_profile and
> seller_profile so depending on the user type then that's the profile they
> get?
>
>
>
> I know they could share the same but get the buyers profile might have 30
> fields to get which some fields can not be null when saving yet the seller
> has only 10 fields pretty much optional. I figure it would be easier to
keep
> the profiles specific to the role so I will not run into validation
problems
> where say 5 fields are required for 1 role and the other the 5 are
> optional.
>
>
>
> Ideas? Thoughts? Suggestions?
>
>
>
> Thanks all.
>
>
>
> Dave
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscribe@googlegroups.com For more options, visit this group
at
> http://groups.google.com/group/cake-php?hl=en
>
Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.
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+unsubscribe@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment