You are here

function profile_user_load in Drupal 7

Implements hook_user_load().

File

modules/profile/profile.module, line 253
Support for configurable user profiles.

Code

function profile_user_load($users) {
  $result = db_query('SELECT f.name, f.type, v.uid, v.value FROM {profile_field} f INNER JOIN {profile_value} v ON f.fid = v.fid WHERE uid IN (:uids)', array(
    ':uids' => array_keys($users),
  ));
  foreach ($result as $record) {
    if (empty($users[$record->uid]->{$record->name})) {
      $users[$record->uid]->{$record->name} = _profile_field_serialize($record->type) ? unserialize($record->value) : $record->value;
    }
  }
}