19 declare(strict_types=1);
42 $ilDB = $DIC->database();
44 $usr_ids_to_request = array_diff($usr_ids, self::$requested_usr_ids);
45 self::$requested_usr_ids = array_merge(self::$requested_usr_ids, $usr_ids_to_request);
46 self::$requested_usr_ids_key_map = array_flip(self::$requested_usr_ids);
48 if ($usr_ids_to_request) {
49 $in =
$ilDB->in(
'ud.usr_id', $usr_ids_to_request,
false,
'integer');
51 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 53 INNER JOIN object_data od ON od.obj_id = ud.usr_id 54 LEFT JOIN usr_pref pprof ON pprof.usr_id = ud.usr_id AND pprof.keyword = %s 55 LEFT JOIN usr_pref pgen ON pgen.usr_id = ud.usr_id AND pgen.keyword = %s 56 LEFT JOIN usr_pref pup ON pup.usr_id = ud.usr_id AND pup.keyword = %s 62 [
'text',
'text',
'text'],
63 [
'public_profile',
'public_gender',
'public_upload']
68 $user->setId((
int) $row[
'usr_id']);
69 $user->setLogin($row[
'login']);
70 $user->setGender($row[
'gender'] ??
'');
71 $user->setUTitle($row[
'title'] ??
'');
72 $user->setFirstname($row[
'firstname'] ??
'');
73 $user->setLastname($row[
'lastname'] ??
'');
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[(
int) $row[
'usr_id']] = $user;
89 if (!isset(self::$requested_usr_ids_key_map[$usr_id])) {
90 self::preloadUserObjects([$usr_id]);
93 return self::$user_instances[$usr_id] ?? null;