34 public static function preloadUserObjects(array $usr_ids)
41 $usr_ids_to_request = array_diff($usr_ids, self::$requested_usr_ids);
42 self::$requested_usr_ids = array_merge(self::$requested_usr_ids, $usr_ids_to_request);
43 self::$requested_usr_ids_key_map = array_flip(self::$requested_usr_ids);
45 if($usr_ids_to_request)
47 $in = $ilDB->in(
'ud.usr_id', $usr_ids_to_request,
false,
'integer');
49 SELECT ud.usr_id, od.create_date, login, firstname, lastname, ud.title, gender, pprof.value public_profile, pgen.value public_gender, pup.value public_upload
51 INNER JOIN object_data od ON od.obj_id = ud.usr_id
52 LEFT JOIN usr_pref pprof ON pprof.usr_id = ud.usr_id AND pprof.keyword = %s
53 LEFT JOIN usr_pref pgen ON pgen.usr_id = ud.usr_id AND pgen.keyword = %s
54 LEFT JOIN usr_pref pup ON pup.usr_id = ud.usr_id AND pup.keyword = %s
60 array(
'text',
'text',
'text'),
61 array(
'public_profile',
'public_gender',
'public_upload')
64 while(
$row = $ilDB->fetchAssoc(
$res))
68 $user->setLogin(
$row[
'login']);
69 $user->setGender(
$row[
'gender']);
70 $user->setTitle(
$row[
'title']);
71 $user->setFirstname(
$row[
'firstname']);
72 $user->setLastname(
$row[
'lastname']);
73 $user->create_date =
$row[
'create_date'];
74 $user->setPref(
'public_profile',
$row[
'public_profile']);
75 $user->setPref(
'public_gender',
$row[
'public_gender']);
76 $user->setPref(
'public_upload',
$row[
'public_upload']);
78 self::$user_instances[
$row[
'usr_id']] = $user;
95 if(!array_key_exists(
$usr_id, self::$requested_usr_ids_key_map))
97 self::preloadUserObjects(array(
$usr_id));
100 return isset(self::$user_instances[
$usr_id]) ? self::$user_instances[
$usr_id] : NULL;