On Thu, Sep 2, 2010 at 1:55 PM, DerBjörn <[email protected]> wrote: > Hi, > > I have a table 'users' and a table 'profiles' in hasOne relation > (table 'profiles_users'). > At the same time i save a user i want also save his profile. I > searched and found the other here: > http://book.cakephp.org/view/84/Saving-Related-Model-Data-hasOne-hasMany-belongsTo > > Now a profile gets created at the same time a user does, but the > profiles_users table stays always empty... > How do i connect both models in this table via dataset? What i have to > do that the relations table get filled automatically with the ids of > user and its profile?
A join table is not necessary for hasOne. The association is made using a foreign_key in one of the tables. In your case, there should be a user_id column in the profiles table. 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
