I think your better off using a belongsTo relationship in the case of
a user profile though.
This way your profile table contains the foreign key instead of the
user's table.
Otherwise you have to do nasty things like, save the profile first,
get its ID, and then save it to the profile_id in the users table.
When instead you can save the user, get its newly created ID, and then
save the profile. With this method I know transactions are used with
the other route I'm sure you could but seems like it would be a pain.
Someone please correct me if I'm wrong.
On Jul 15, 8:03 am, "Daniel M.K." <daniel....@gmail.com> wrote:
> Hi Guys, i need a bit of help with this.
>
> I have a hasOne relationship between USER and PROFILE, when user
> registers it assigns a profile, this is fine. What i want to do is to
> auto assign a profile that will already be inserted in the database,
> by some fields like email, first name and last name.
>
> Is this possible ? Thanks in advice.
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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment