mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 16:45:17 +00:00
Implement Comment object for the get_single method
This commit is contained in:
@ -12,11 +12,21 @@ class Comment extends BaseUniqueObject {
|
||||
private $postID;
|
||||
private $time_sent;
|
||||
private $content;
|
||||
private $image_path;
|
||||
private $image_url;
|
||||
private $img_path;
|
||||
private $img_url;
|
||||
private $likes;
|
||||
private $userLike;
|
||||
|
||||
/**
|
||||
* Public constructor
|
||||
*/
|
||||
public function __construct(){
|
||||
//Initialize some values
|
||||
$this->postID = 0;
|
||||
$this->userID = 0;
|
||||
$this->likes = -1;
|
||||
}
|
||||
|
||||
//Set and get user ID
|
||||
public function set_userID(int $userID){
|
||||
$this->userID = $userID;
|
||||
@ -31,6 +41,10 @@ class Comment extends BaseUniqueObject {
|
||||
$this->postID = $postID;
|
||||
}
|
||||
|
||||
public function has_postID() : bool {
|
||||
return $this->postID > 0;
|
||||
}
|
||||
|
||||
public function get_postID() : int {
|
||||
return $this->postID;
|
||||
}
|
||||
@ -88,6 +102,10 @@ class Comment extends BaseUniqueObject {
|
||||
$this->likes = $likes;
|
||||
}
|
||||
|
||||
public function has_likes() : bool {
|
||||
return $this->likes > -1;
|
||||
}
|
||||
|
||||
public function get_likes() : int {
|
||||
return $this->likes;
|
||||
}
|
||||
|
Reference in New Issue
Block a user