method getParticipants documentation in bbn\Appui\Chat
Returns the participants of the given chat as an array of id_user.
function(string $id_chat, bool $with_current = true, bool $last_activity = false)
{
if ($this->check()) {
$ucfg = $this->user->getClassCfg();
$cfg = [
'table' => 'bbn_chats_users',
'fields' => ['bbn_chats_users.id_user'],
'join' => [[
'table' => $ucfg['table'],
'on' => [
'conditions' => [[
'field' => 'bbn_chats_users.id_user',
'exp' => $ucfg['table'].'.'.$ucfg['arch']['users']['id']
], [
'field' => $ucfg['table'].'.'.$ucfg['arch']['users']['active'],
'value' => 1
]]
]
]],
'where' => [
'conditions' => [[
'field' => 'id_chat',
'value' => $id_chat
], [
'field' => 'active',
'value' => 1
]]
]
];
if (!$with_current) {
$cfg['where']['conditions'][] = [
'field' => 'bbn_chats_users.id_user',
'operator' => '!=',
'value' => $this->user->getId()
];
}
if ($last_activity) {
$cfg['fields'] = [
'id' => 'bbn_chats_users.id_user',
'lastActivity' => 'bbn_chats_users.last_activity',
// 'lastUserActivity' => 'UNIX_TIMESTAMP(MAX('.$ucfg['tables']['sessions].'.'.$ucfg['arch']['sessions']['last_activity'].'))'
];
/* $cfg['join'][] = [
'table' => $ucfg['tables']['sessions],
'type' => 'left',
'on' => [
'conditions' => [[
'field' => $ucfg['tables']['sessions].'.'.$ucfg['arch']['sessions']['id_user'],
'exp' => 'bbn_chats_users.id_user'
]]
]
];
$cfg['group_by'] = [$ucfg['tables']['sessions].'.'.$ucfg['arch']['sessions']['id_user']]; */
return $this->db->rselectAll($cfg);
}
return $this->db->getFieldValues($cfg);
}
return null;
}
Returns the participants of the given chat as an array of id_user. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions