mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 22:09:29 +00:00
Can get all the messages of a conversation.
This commit is contained in:
parent
b11bd0740f
commit
9e85b25c1a
@ -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
|
* Check whether a conversation exists or not
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user