gobblez wrote:
> This is a summary of my DB tables and fields:
>
> users
> -------
> id | email | password | group_id | created | modified
>
> groups
> ---------
> id | name | created | modified
>
> User.php
> ------------
> class User extends AppModel
> {
> // Its always good practice to include this variable.
> var $name = 'User';
> var $hasOne = array('Group' =>
I think this association should be changed in belongsTo instead of
hasOne?
> 'foreignKey' => 'user_id'
Anyway, where is the user_id in any of mentioned tables?
I thinks this is wrong. There is no foreign key for the table groups.
> Group.php
> --------------
> class Group extends AppModel
This sounds ok to me ;)
Please read here:
http://manual.cakephp.org/chapter/models
Section 4 : Associations
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---