Also, you can still make use of pre-made profiles (it kind of seems
like thats what you were wanting to do, since you said the profile is
already inserted into the DB)

I would make a profile templates table, let the user select which one
or enter data, pull in the template data, over write anything the user
provided, then save it to the profile.  If your consistent with your
naming it can all be done really quickly without much overhead.


On Jul 16, 7:40 am, Anthony <anthony.c.fra...@gmail.com> wrote:
> You would use the afterSave behavior on your users controller.
>
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to