mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 13:59:29 +00:00
Get the list of followers of a group
This commit is contained in:
parent
ffcef67b70
commit
d99b4c7f18
@ -231,6 +231,29 @@ class GroupsComponent {
|
||||
return $this->multipleDBToGroupMember($members);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of members of the group that follows it
|
||||
*
|
||||
* @param int $groupID The ID of the target group
|
||||
* @return array The list of members
|
||||
*/
|
||||
public function getListFollowers(int $groupID) : array {
|
||||
|
||||
$result = db()->select(
|
||||
self::GROUPS_MEMBERS_TABLE,
|
||||
"WHERE groups_id = ? AND following = 1",
|
||||
array($groupID),
|
||||
array("user_id")
|
||||
);
|
||||
|
||||
//Parse the list of IDs
|
||||
$list = array();
|
||||
foreach($result as $el)
|
||||
$list[] = $el["user_id"];
|
||||
return $list;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Count the number of a kind of membership in a group
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user