From 9e85b25c1a8237a208fc9d13a8e59e990b11349c Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 27 May 2018 11:36:27 +0200 Subject: [PATCH] Can get all the messages of a conversation. --- classes/components/Conversations.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/classes/components/Conversations.php b/classes/components/Conversations.php index 0c680a5..2a1b63a 100644 --- a/classes/components/Conversations.php +++ b/classes/components/Conversations.php @@ -628,6 +628,27 @@ class Conversations { } + /** + * Get all the messages of a conversation + * + * @param int $conversationID The ID of the target conversation + * @return array The list of messages + */ + public function getAllMessages(int $conversationID) : array { + + //Define conditions + $conditions = "WHERE ID_".$this->conversationsListTable." = ? ORDER BY ID"; + $condVals = array( + $conversationID + ); + + //Perform request + $messages = $this->getMessages($conditions, $condVals); + + //Return messages + return $messages; + } + /** * Check whether a conversation exists or not *