mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-20 00:55:19 +00:00
Latest posts thread can includes groups posts.
This commit is contained in:
@ -254,6 +254,29 @@ class GroupsComponent {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of groups a user is following
|
||||
*
|
||||
* @param int $userID The ID of the target group
|
||||
* @return array The IDs of the groups followed by the user
|
||||
*/
|
||||
public function getListFollowedByUser(int $userID) : array {
|
||||
|
||||
$result = db()->select(
|
||||
self::GROUPS_MEMBERS_TABLE,
|
||||
"WHERE user_id = ? AND following = 1",
|
||||
array($userID),
|
||||
array("groups_id")
|
||||
);
|
||||
|
||||
//Parse the list of IDs
|
||||
$list = array();
|
||||
foreach($result as $el)
|
||||
$list[] = $el["groups_id"];
|
||||
return $list;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Count the number of a kind of membership in a group
|
||||
*
|
||||
|
Reference in New Issue
Block a user