function profile_save_profile in Drupal 7
Same name and namespace in other branches
- 4 modules/profile.module \profile_save_profile()
- 5 modules/profile/profile.module \profile_save_profile()
- 6 modules/profile/profile.module \profile_save_profile()
2 calls to profile_save_profile()
- profile_user_insert in modules/
profile/ profile.module - Implements hook_user_insert().
- profile_user_presave in modules/
profile/ profile.module - Implements hook_user_presave().
File
- modules/
profile/ profile.module, line 262 - Support for configurable user profiles.
Code
function profile_save_profile(&$edit, $account, $category, $register = FALSE) {
$result = _profile_get_fields($category, $register);
foreach ($result as $field) {
if (_profile_field_serialize($field->type)) {
$edit[$field->name] = serialize($edit[$field->name]);
}
db_merge('profile_value')
->key(array(
'fid' => $field->fid,
'uid' => $account->uid,
))
->fields(array(
'value' => $edit[$field->name],
))
->execute();
}
}