mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Can get all the messages of a conversation.
This commit is contained in:
		@@ -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
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user