You are here

function profile2_form_submit_build_profile in Profile 2 7

Same name and namespace in other branches
  1. 7.2 profile2.module \profile2_form_submit_build_profile()

Submit builder. Extracts the form values and updates the profile entities.

See also

profile2_attach_form()

1 call to profile2_form_submit_build_profile()
profile2_form_submit_handler in ./profile2.module
Submit handler that builds and saves all profiles in the form.

File

./profile2.module, line 703
Support for configurable user profiles.

Code

function profile2_form_submit_build_profile(&$form, &$form_state) {
  foreach ($form_state['profiles'] as $type => $profile) {

    // @see entity_form_submit_build_entity()
    if (isset($form['profile_' . $type]['#entity_builders'])) {
      foreach ($form['profile_' . $type]['#entity_builders'] as $function) {
        $function('profile2', $profile, $form['profile_' . $type], $form_state);
      }
    }
    field_attach_submit('profile2', $profile, $form['profile_' . $type], $form_state);
  }
}