User hasOne Profile , Profile belongsTo User

 

But in my Profile table I do not have user_id, I just have id which is the
User.id created automatically when the User creates an account. To me it
seems like why give the Profile a separate ID when essentially its just an
extension of the User. 

Everything else is related to the Profile

 

Profile:

var $belongsTo = array(

'User' => array(

                                'className' => 'User',

                                'foreignKey' => 'user_id')


);

 

User:

var $hasOne = array(

'Role' => array(

                                'className' => 'Role',

                                'foreignKey' => 'id',

                                'dependent' => false),

                'Profile' => array(

                                'className' => 'Profile',

                                'foreignKey' => 'id',

                                'dependent' => false)

);

 

Is this set up wrong?

 

Thanks,

 

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 [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