Could you please provide some code snippets as I don't see the 
difference between our approaches?

Siegfried Hirsch wrote:
> How about defining an ProfilesController as the base class for the
> other controllers for your different models.
> 
> That what we have done in a similar case, where we had contacts and
> people and companies
> depending on the ContactsController.
> 
> 
> On Wed, Sep 17, 2008 at 8:10 AM, Günther Theilen <[EMAIL PROTECTED]> wrote:
>> Hi!
>>
>> I'm working on a new project and right now I'm struggling a bit to put
>> the requirements together in a proper cake-like way.
>>
>> I use Auth/ACL which is set up and works fine. The users who can log-in
>> belong to three different groups. These groups are defined by a field
>> "role_id" in the user table.
>>
>> Now I want to add profiles for the users. The problem is that each group
>> has a different type of profile with different fields in it so I defined
>> three models for the profiles.
>>
>> My first idea was to do something like this in my user model:
>>
>> var $hasOne = array(
>>   'AdminProfile' => array(
>>     'className' => 'AdminProfile',
>>     'conditions' => 'User.role_id = 1'
>>   ),
>>   'EditorProfile' => array(
>>     'className' => 'EditorProfile',
>>     'conditions' => 'User.role_id = 2'
>>   ),
>>   'ReviewerProfile' => array(
>>     'className' => 'ReviewerProfile',
>>     'conditions' => 'User.role_id = 3'
>>   )
>> );
>>
>> Which seems to work to a degree but is a bit of a hassle when it comes
>> to editing the profiles and validating the form data.
>>
>> How would you solve this?
>>
>> Regards
>> Guenther
>>
> 
> 
> 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to