mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 00:25:18 +00:00
Optimized get friends list function
This commit is contained in:
@ -43,6 +43,7 @@ class friends {
|
||||
$this->friendsTable.".ID_amis",
|
||||
$this->friendsTable.".actif",
|
||||
$this->friendsTable.".abonnement",
|
||||
$this->friendsTable.".autoriser_post_page"
|
||||
);
|
||||
|
||||
//Perform the request on the database
|
||||
@ -364,6 +365,7 @@ class friends {
|
||||
$friend->setAccepted($data["actif"] == 1);
|
||||
$friend->setFollowing($data["abonnement"] == 1);
|
||||
$friend->setLastActivityTime($data["last_activity"]);
|
||||
$friend->setCanPostTexts($data["autoriser_post_page"] == 1);
|
||||
|
||||
return $friend;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ class Friend {
|
||||
private $accepted;
|
||||
private $following;
|
||||
private $last_activity_time;
|
||||
private $can_post_texts;
|
||||
|
||||
//Set and get friend ID
|
||||
public function setFriendID(int $id){
|
||||
@ -44,4 +45,12 @@ class Friend {
|
||||
public function getLastActivityTime() : int {
|
||||
return $this->last_activity_time;
|
||||
}
|
||||
|
||||
//Set and get the post creation authorization status
|
||||
public function setCanPostTexts(bool $can_post_texts){
|
||||
$this->can_post_texts = $can_post_texts;
|
||||
}
|
||||
public function canPostTexts() : bool {
|
||||
return $this->can_post_texts;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user