From 3dd0d3792a4000c5da3556e85c09dad01a05966e Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 23 Apr 2018 18:30:47 +0200 Subject: [PATCH] Created ConversationInfo object --- classes/models/ConversationInfo.php | 88 +++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 classes/models/ConversationInfo.php diff --git a/classes/models/ConversationInfo.php b/classes/models/ConversationInfo.php new file mode 100644 index 0000000..70bc7e3 --- /dev/null +++ b/classes/models/ConversationInfo.php @@ -0,0 +1,88 @@ +members = array(); + } + + //Set and get owner ID + public function set_id_owner(int $id_owner){ + $this->id_owner = $id_owner; + } + + public function get_id_owner() : int { + return $this->id_owner; + } + + //Set and get last activity time + public function set_last_active(int $last_active){ + $this->last_active = $last_active; + } + + public function get_last_active() : int { + return $this->last_active; + } + + //Set and get conversation name + public function set_name(string $name){ + $this->name = $name == "" ? null : $name; + } + + public function has_name() : bool { + return $this->name != null; + } + + public function get_name() : string { + return $this->name != null ? $this->name : "null"; + } + + //Set and get following state of the conversation + public function set_following(bool $following){ + $this->following = $following; + } + + public function is_following() : bool { + return $this->following; + } + + //Set and get saw last message status + public function set_saw_last_message(bool $saw_last_message){ + $this->saw_last_message = $saw_last_message; + } + + public function is_saw_last_message() : bool { + return $this->saw_last_message; + } + + //Set and get the members of the conversation + public function set_members(array $members){ + $this->members = $members; + } + + public function add_member(int $member){ + $this->members[] = $member; + } + + public function get_members() : array { + return $this->members; + } +} \ No newline at end of file