33 public static function preloadUserObjects(array $usr_ids)
40 $usr_ids_to_request = array_diff($usr_ids, self::$requested_usr_ids);
41 self::$requested_usr_ids = array_merge(self::$requested_usr_ids, $usr_ids_to_request);
42 self::$requested_usr_ids_key_map = array_flip(self::$requested_usr_ids);
44 if($usr_ids_to_request)
46 $in = $ilDB->in(
'ud.usr_id', $usr_ids_to_request,
false,
'integer');
48 SELECT ud.usr_id, login, firstname, lastname, title, gender, pprof.value public_profile,pup.value public_upload
50 LEFT JOIN usr_pref pprof ON pprof.usr_id = ud.usr_id AND pprof.keyword = %s
51 LEFT JOIN usr_pref pup ON pup.usr_id = ud.usr_id AND pup.keyword = %s
57 array(
'text',
'text',
'text'),
58 array(
'public_profile',
'public_gender',
'public_upload')
61 while(
$row = $ilDB->fetchAssoc(
$res))
65 $user->setLogin(
$row[
'login']);
66 $user->setGender(
$row[
'gender']);
67 $user->setTitle(
$row[
'title']);
68 $user->setFirstname(
$row[
'firstname']);
69 $user->setLastname(
$row[
'lastname']);
70 $user->setPref(
'public_profile',
$row[
'public_profile']);
71 $user->setPref(
'public_upload',
$row[
'public_upload']);
73 self::$user_instances[
$row[
'usr_id']] = $user;
90 if(!array_key_exists(
$usr_id, self::$requested_usr_ids_key_map))
92 self::preloadUserObjects(array(
$usr_id));
95 return isset(self::$user_instances[
$usr_id]) ? self::$user_instances[
$usr_id] : NULL;