Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6566079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:10:26+00:00 2026-05-25T14:10:26+00:00

I have a registration form that includes sfRegistration and sfProfile, which after completion, get’s

  • 0

I have a registration form that includes sfRegistration and sfProfile, which after completion, get’s redirected to another form – to determine the user’s corporation and is a seperate module. The sfProfile includes a field from the corporation module… the corporate_id. But since the corporate_id is not part of the profile, it does not get included at registration time. Here’s the question, after completion of the corporation module, what is the best way to update the user’s profile with the corporate_id of the newly completed corporation module? I tried this:

public function postSave()
{
$corpId = $this->form->getId();
$logged_user_id = sfContext::getInstance()->getUser()->getId();
Doctrine_Query::create()
->update('sf_guard_user_profile p')
->set('p.corporate_id', $corpId)
->where('p.user_id' == $logged_user_id )
->execute();
}

placed into the action of the company module, but it is not updating the profile with the company_id.

Suggestions?

UPDATE – per request, here is the information requested: (my >>lib>form>>doctrine>>CorporationForm.class.php is empty… I was trying my functions in the actions class… which may be the issue). Just to clarify, I just need to update the user’s profile with the newly created corporate_id after the user completes the corporation module.
And my schema:

sfGuardUser:
  actAs: [Timestampable]
  columns:
    first_name: string(255)
    last_name: string(255)
    email_address:
      type: string(255)
      notnull: true
      unique: true
    username:
      type: string(128)
      notnull: true
      unique: true
    algorithm:
      type: string(128)
      default: sha1
      notnull: true
    salt: string(128)
    password: string(128)
    is_active:
      type: boolean
      default: 1
    is_super_admin:
      type: boolean
      default: false
    last_login:
      type: timestamp
  indexes:
    is_active_idx:
      fields: [is_active]
  relations:
    Groups:
      class: sfGuardGroup
      local: user_id
      foreign: group_id
      refClass: sfGuardUserGroup
      foreignAlias: Users
    Permissions:
      class: sfGuardPermission
      local: user_id
      foreign: permission_id
      refClass: sfGuardUserPermission
      foreignAlias: Users

sfGuardUserProfile:
 actAs:            { Timestampable: ~ }
 columns:
  id: { type: integer, primary: true, notnull: true, autoincrement: true, unique: true }
  user_id: { type: integer }
  corporate_id: { type: integer }
  type_id: { type: integer, notnull: true }
  prefix_id: { type: integer }
  middle_name: { type: string(55) }
  suffix_id: { type: integer }
  phone: { type: string(55), notnull: true }
  home_address_line_one: { type: string }
  home_address_line_two: { type: string }
  home_city: { type: string }
  state_id: { type: integer }
  home_zip: { type: integer } 
 relations:
  User: { class: sfGuardUser, local: user_id, foreign: id, type: one, foreignType: one,     foreignAlias: Profile }
  Type: { local: type_id, foreign: id, type: one, foreignAlias: Types } 
  Prefix: { local: prefix_id, foreign: id, type: one, foreignAlias: Prefixs } 
  Suffix: { local: suffix_id, foreign: id, type: one, foreignAlias: Suffixs }   
  State:  { local: state_id, foreign: id, foreignAlias: States }  
  Corporation: { local: corporate_id, foreign: id, foreignAlias: Corporations }

Corporation:
  columns:
   id:             { type: integer, primary: true, notnull: true, autoincrement: true,    unique: true }
   user_id:        { type: integer }
   name:           { type: string(55), notnull: true }
   address_line1:   { type: string(255), notnull: true }
   address_line2:   { type: string(255), notnull: true }
   city:           { type: string(25), notnull: true }
   state_id:       { type: integer, notnull: true }
   zip:            { type: string(25), notnull: true }
   phone:          { type: string(25), notnull: true }
   email:          { type: string(100), notnull: true }
   website:        { type: string(100) }
   logo:           { type: string(255) }
  relations:
    User: { class: sfGuardUser, local: user_id, foreign: id, foreignAlias: Users }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:10:26+00:00Added an answer on May 25, 2026 at 2:10 pm

    Don’t forget the ->save();

        public function setId() 
      {
            $user_id = $this->getUser()->getGuardUser()->getId();
            $corp_id = 1;
            $user_profile = Doctrine_Core::getTable('sfGuardUserProfile')->findOneByUserId($user_id);
            $user_profile->setCorporateId($corp_id)->save();
       }
    
      protected function processForm(sfWebRequest $request, sfForm $form)
      {            
        $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
        if ($form->isValid())
        {
            self::setId();        
            $corporation = $form->save();    
            $this->redirect('dashboard/index');      
        }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a product registration form that allows the user to add additional product
I have a basic form that I'm using for member registration. I'm using the
in my project i have one registration form which is developed in C#.net.to this
I have a user registration form that has a password and confirm password field.
I have this registration form which is then validated using "bassistance's" validate.js: $('#pForm').validate({ rules:
I have a registration form that is rendered by the following urlconf -- url(r'^$',
I have a registration form for a website that needs to check if an
I have a registration form that is connected to a database table that uses
I have a registration form that a user can access via invitation. For example,
I have one simple User Registration form. It includes name, age, sex & city.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.