mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 16:45:17 +00:00
Can create posts for groups.
This commit is contained in:
@ -11,6 +11,7 @@ class Notification {
|
||||
* Elements type
|
||||
*/
|
||||
const USER_PAGE = "user_page";
|
||||
const GROUP_PAGE = "group_page";
|
||||
const CONVERSATION = "conversation";
|
||||
const CONVERSATION_MESSAGE = "conversation_message";
|
||||
const POST = "post";
|
||||
|
@ -75,6 +75,22 @@ class Post extends BaseUniqueObjectFromUser {
|
||||
return $this->kind_page == Posts::PAGE_KIND_USER ? $this->kind_page_id : 0;
|
||||
}
|
||||
|
||||
//Set and get the target group ID
|
||||
public function set_group_id(int $group_id){
|
||||
if($group_id > 0){
|
||||
$this->set_kind_page(Posts::PAGE_KIND_GROUP);
|
||||
$this->kind_page_id = $group_id;
|
||||
}
|
||||
}
|
||||
|
||||
public function has_group_id() : bool {
|
||||
return $this->kind_page_id > 0 && $this->kind_page == Posts::PAGE_KIND_GROUP;
|
||||
}
|
||||
|
||||
public function get_group_id() : int {
|
||||
return $this->kind_page == Posts::PAGE_KIND_GROUP ? $this->kind_page_id : 0;
|
||||
}
|
||||
|
||||
|
||||
//Set and get content
|
||||
public function set_content(string $content){
|
||||
|
Reference in New Issue
Block a user