method isAdmin documentation in bbn\Appui\Chat
Checks whether the current user is an admin of the given chat or not.
function(string $id_chat, string $id_user = NULL)
{
if ($this->check()
&& bbn\Str::isUid($id_chat)
&& ($chat = $this->info($id_chat))
&& !$chat['blocked']
&& (bbn\Str::isUid($id_user) || \is_null($id_user))
) {
return (bool)$this->db->count(
'bbn_chats_users', [
'id_chat' => $id_chat,
'id_user' => $id_user ?: $this->user->getId(),
'admin' => 1
]
);
}
return null;
}
Checks whether the current user is an admin of the given chat or not. 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-2023
BBN Solutions