Can get all the memberships of a user at once

This commit is contained in:
2019-05-11 17:48:03 +02:00
parent 9dfc400fe2
commit 50875adc3b
2 changed files with 100 additions and 0 deletions

View File

@ -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
*