Hello: I'm getting this error when I'm trying to implement this code.
The first code block with $user seems to work as the database is
updated, but the second part fails. This is the error:

Unknown record property / related component “sf_guard_user” on
“sfGuardUserProfile”

public function executeCreateAccount()
  {
    $user = new sfGuardUser();
    $user->setUsername($this->getRequestParameter('username'));
    $user->setPassword($this->getRequestParameter('password'));
    $user->setIsActive(false);
    $user->save();

   $profile = new sfGuardUserProfile();
    $profile->setsfGuardUser($user);
    $profile->setEmail($this->getRequestParameter('user_email'));
    $profile->setRemember($this->getRequestParameter('remember',
true));
    $profile->save();

    $this->getRequest()->setAttribute('user', $user);
    $raw_email = $this->sendEmail('user',
'registrationConfirmation');
    $this->logMessage($raw_email, 'debug');

    $this->setFlash('user_email', $this-
>getRequestParameter('user_email'));
    $this->redirect('user/askConfirmation');
  }
Here is my schema.yml for the user profile:

sf_guard_user_profile:
  columns:
    id: { type: integer, primary: true, autoincrement: true }
    user_id: { type: integer }
    firstname: { type: string(255) }
    lastname: { type: string(255) }
    user_email: { type: string(255) }
  relations:
    sfGuardUser:
      type: one
      foreignType: one
      class: sfGuardUser
      local: user_id
      foreign: id
      onDelete: cascade
      foreignAlias: Profile

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to