Work progress on notifications.

This commit is contained in:
Pierre
2018-02-17 19:25:33 +01:00
parent b9cb4e50fc
commit 1194bb4b71
3 changed files with 250 additions and 1 deletions

View File

@ -10,8 +10,11 @@ class Notification {
/**
* Elements type
*/
const USER_PAGE = "user_page";
const CONVERSATION = "conversation";
const POST_TEXT = "post";
const CONVERSATION_MESSAGE = "conversation_message";
const POST = "post";
const POST_TEXT = "post_text";
const POST_IMAGE = "post_img";
const POST_YOUTUBE = "post_youtube";
const POST_MOVIE = "post_movie";
@ -24,9 +27,17 @@ class Notification {
/**
* Event type
*/
const COMMENT_CREATED = "comments";
const ELEM_CREATED = "elem_created";
const ELEM_UPDATED = "elem_updated";
/**
* Event visibility
*/
const EVENT_PRIVATE = "event_private";
const EVENT_PUBLIC = "event_public";
//Private fields
private $id;
private $time;
@ -36,9 +47,23 @@ class Notification {
private $on_elem_id;
private $on_elem_type;
private $type;
private $event_visibility;
private $from_container_id;
private $from_container_type;
/**
* Default constructor of the notification
*/
public function __construct(){
//Notification not seen by default
$this->seen = false;
//By default, the notification does not have any contener
$this->from_container_id = 0;
$this->from_container_type = "";
}
/**
* Set notification id
@ -185,6 +210,24 @@ class Notification {
return $this->type;
}
/**
* Set notification event visibility
*
* @param string $visibility The visibility of the notification
*/
public function set_event_visibility(string $event_visibility){
$this->event_visibility = $event_visibility;
}
/**
* Get notification event visibility
*
* @return string The visibility of the notification
*/
public function get_event_visibility() : string {
return $this->event_visibility;
}
/**
* Set notification target container element type (if any)
*