Definition at line 33 of file Subscriber.php.
◆ __construct()
◆ getDataByUserIds()
ILIAS\OnScreenChat\Repository\Subscriber::getDataByUserIds |
( |
array |
$usrIds | ) |
|
- Parameters
-
- Returns
- array<int, array{public_name: string, profile_image: string}>
Definition at line 98 of file Subscriber.php.
References $data, ilUserUtil\getNamePresentation(), ilWACSignedPath\getTokenMaxLifetimeInSeconds(), and ilWACSignedPath\setTokenMaxLifetimeInSeconds().
Referenced by ILIAS\OnScreenChat\Repository\Subscriber\getInitialUserProfileData().
100 $usrIds = array_filter(array_map(
'intval', array_map(
'trim', $usrIds)));
109 foreach ($usrIds as $usr_id) {
110 $publicImage = $publicData[$usr_id][
'img'] ??
'';
113 if (isset($publicData[$usr_id])) {
115 if (isset($publicData[$usr_id][
'login'])) {
116 $publicName = $login = $publicData[$usr_id][
'login'];
119 if (isset($publicData[$usr_id][
'public_profile']) && $publicData[$usr_id][
'public_profile']) {
120 $publicName = implode(
' ', array_filter(array_map(
'trim', [
121 (
string) ($publicData[$usr_id][
'firstname'] ??
''),
122 (
string) ($publicData[$usr_id][
'lastname'] ??
''),
125 if ($publicName ===
'') {
126 $publicName = $login;
132 'public_name' => $publicName,
133 'profile_image' => $publicImage
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static setTokenMaxLifetimeInSeconds(int $token_max_lifetime_in_seconds)
static getTokenMaxLifetimeInSeconds()
◆ getInitialUserProfileData()
ILIAS\OnScreenChat\Repository\Subscriber::getInitialUserProfileData |
( |
| ) |
|
- Returns
- array<int, array{public_name: string, profile_image: string}>
Definition at line 47 of file Subscriber.php.
References $res, ILIAS\OnScreenChat\Repository\Subscriber\getDataByUserIds(), and ILIAS\Repository\user().
49 $conversationIds = [];
51 $res = $this->db->queryF(
52 'SELECT DISTINCT(conversation_id) FROM osc_activity WHERE user_id = %s',
54 [$this->
user->getId()]
56 while ($row = $this->db->fetchAssoc(
$res)) {
57 $conversationIds[$row[
'conversation_id']] = $row[
'conversation_id'];
60 $res = $this->db->queryF(
61 'SELECT DISTINCT(conversation_id) FROM osc_messages WHERE user_id = %s',
63 [$this->
user->getId()]
65 while ($row = $this->db->fetchAssoc(
$res)) {
66 $conversationIds[$row[
'conversation_id']] = $row[
'conversation_id'];
69 if (0 === count($conversationIds)) {
75 $in = $this->db->in(
'id', $conversationIds,
false,
'text');
76 $res = $this->db->query(
'SELECT DISTINCT(participants) FROM osc_conversation WHERE ' . $in);
77 while ($row = $this->db->fetchAssoc(
$res)) {
78 $participants = json_decode($row[
'participants'],
true, 512, JSON_THROW_ON_ERROR);
80 if (is_array($participants)) {
81 $usrIds = array_unique(array_merge($usrIds, array_filter(array_map(
static function (
$user):
int {
83 return (
int)
$user[
'id'];
getDataByUserIds(array $usrIds)
◆ $db
◆ $user
ilObjUser ILIAS\OnScreenChat\Repository\Subscriber::$user |
|
protected |
The documentation for this class was generated from the following file: