Can get from the API the list of targets where user can create posts

This commit is contained in:
2019-05-19 15:35:43 +02:00
parent f8e6aa2d3c
commit 75940b53f3
3 changed files with 71 additions and 0 deletions

View File

@ -76,6 +76,28 @@ class friends {
}
/**
* Get the list of friends of a given user that allows him to
* create posts on their page
*
* @param $userID The ID of the target user
* @return array The list of friends of a user that allows him
* to create posts
*/
public function getListThatAllowPostsFromUser(int $userID) : array {
$list = db()->select(
$this->friendsTable,
"WHERE autoriser_post_page = 1 AND ID_amis = ?",
array($userID),
array("ID_personne")
);
foreach($list as $num=>$info)
$list[$num] = (int)$info["ID_personne"];
return $list;
}
/**
* Respond to a friendship request
*