Hello,
I'm new to cake, and a bit puzzled with the associated models.
Suppose I have a User Model and a Theme model. A user can have only
one theme.
I would think this should be a hasOne association in the User model.
class User extends AppModel
{
var $name = 'User';
var $hasOne = array ( 'Theme' => array ( 'className' => 'Theme',
'foreignKey' => 'theme_id'));
}
Notice that I have written 'theme_id' as the foreign key. Following
the examples in the manual this should be user_id.
And indeed, this is not working. What do I miss?
If you have a user that selects one of the themes, I would expect a
theme_id field in the user table. And not a user_id field in the theme
table. How does this work? Do I need another type of association?
Thanks in advance,
pieter
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---