diff --git a/classes/components/GroupsComponent.php b/classes/components/GroupsComponent.php index e7e36d1..d2ee32e 100644 --- a/classes/components/GroupsComponent.php +++ b/classes/components/GroupsComponent.php @@ -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 *