mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-20 00:55:19 +00:00
Can get all the memberships of a user at once
This commit is contained in:
@ -172,6 +172,25 @@ class GroupsComponent {
|
||||
return $this->dbToAdvancedGroupInfo($info[0], null, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the timestamp of the estimated last activity on the group
|
||||
*
|
||||
* @param int $id The ID of the target group
|
||||
* @return int The time of last activity on the group
|
||||
*/
|
||||
public function getLastActivity(int $id) : int {
|
||||
|
||||
// Query the database
|
||||
$posts = components()->posts->getGroupPosts($id, true, 0, 1);
|
||||
|
||||
if(count($posts) == 0)
|
||||
return 0;
|
||||
|
||||
else
|
||||
return $posts[0]->get_time_sent();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a group settings
|
||||
*
|
||||
|
Reference in New Issue
Block a user