Actually, i find a solution, and i'm pretty sure i miss a point
somewhere into the plugins or the impact of the relationship within
the schema.yml indeed.

I implement that solution :

In my case, i built the register module explain there :
http://www.symfony-project.org/blog/2008/12/03/call-the-expert-simple-registration-with-sfdoctrineguardplugin


at the end the solution was to put this :

  public function configure()
  {

      $profileForm = new ProfileForm($this->object->Profile);
      unset($profileForm['id'], $profileForm['sf_guard_user_id']);
      $this->embedForm('Profile', $profileForm);

      //.....


This code is located into my RegisterForm.class.php who is actually
extend the sfguard sfGuardUserForm.

So everything is up and running, hope that help.

thanks


On Jan 24, 2:08 am, sikk <[email protected]> wrote:
> Hi guys,
>
> I try to see what i'm doing wrong at the moment to make this stop
> creating twice row in profile when i create a user with the profile
> form embed.
>
> Someone see something wrong in this ?
>
> Profile:
>   columns:
>     sf_guard_user_id: integer(4)
>     first_name: string(255)
>     middle_name: string(255)
>     last_name: string(255)
>     email_address: string(255)
>   relations:
>     User:
>       class: sfGuardUser
>       foreignType: one
>
> class registerActions extends sfActions
> {
>   public function executeIndex(sfWebRequest $request)
>   {
>       $this->form = new RegisterForm();
>       $profileForm = new ProfileForm();
>       unset($profileForm['id'], $profileForm['sf_guard_user_id']);
>       $this->form->embedForm('Profile', $profileForm);
>
>     if ($request->isMethod('post'))
>     {
>       $this->form->bind($request->getParameter('sf_guard_user'));
>
>       if ($this->form->isValid())
>       {
>         $this->form->save();
>         $this->getUser()->signIn($this->form->getObject());
>         //$this->redirect('@homepage');
>       }
>     }
>
>   }
>
> }
>
> Thanks a lot !
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to