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, pupgen.value public_gender
50 LEFT JOIN usr_pref pprof ON pprof.usr_id = ud.usr_id AND pprof.keyword = %s
51 LEFT JOIN usr_pref pupgen ON pupgen.usr_id = ud.usr_id AND pupgen.keyword = %s
52 LEFT JOIN usr_pref pup ON pup.usr_id = ud.usr_id AND pup.keyword = %s
58 array(
'text',
'text',
'text'),
59 array(
'public_profile',
'public_gender',
'public_upload')
62 while(
$row = $ilDB->fetchAssoc(
$res))
66 $user->setLogin(
$row[
'login']);
67 $user->setGender(
$row[
'gender']);
68 $user->setTitle(
$row[
'title']);
69 $user->setFirstname(
$row[
'firstname']);
70 $user->setLastname(
$row[
'lastname']);
71 $user->setPref(
'public_profile',
$row[
'public_profile']);
72 $user->setPref(
'public_upload',
$row[
'public_upload']);
73 $user->setPref(
'public_gender',
$row[
'public_gender']);
75 self::$user_instances[
$row[
'usr_id']] = $user;
92 if(!array_key_exists(
$usr_id, self::$requested_usr_ids_key_map))
94 self::preloadUserObjects(array(
$usr_id));
97 return isset(self::$user_instances[
$usr_id]) ? self::$user_instances[
$usr_id] : NULL;