mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-27 15:59:29 +00:00
Moved conversations classes
This commit is contained in:
parent
f84a8df0d8
commit
f39d162277
@ -5,7 +5,7 @@
|
|||||||
* @author Pierre HUBERT
|
* @author Pierre HUBERT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class conversationsController{
|
class ConversationsController{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the conversations list
|
* Get the conversations list
|
||||||
@ -460,4 +460,24 @@ class conversationsController{
|
|||||||
return $data;
|
return $data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn ConversationMessage object into API entry
|
||||||
|
*
|
||||||
|
* @param ConversationMessage $message The message to convert
|
||||||
|
* @return array Valid dataset for the api
|
||||||
|
*/
|
||||||
|
private static function ConvMessageToAPI(ConversationMessage $message) : array {
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
|
||||||
|
$data["ID"] = $message->get_id();
|
||||||
|
$data["ID_user"] = $message->get_userID();
|
||||||
|
$data["time_insert"] = $message->get_time_sent();
|
||||||
|
$data["message"] = $message->has_message() ? $message->get_message() : "";
|
||||||
|
$data["image_path"] = $message->has_image_path() ? $message->get_image_path() : null;
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,7 +5,7 @@
|
|||||||
* @author Pierre HUBERT
|
* @author Pierre HUBERT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class conversations {
|
class Conversations {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var String $conversationsListTable Name of the conversation list table
|
* @var String $conversationsListTable Name of the conversation list table
|
||||||
@ -874,4 +874,4 @@ class conversations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Register component
|
//Register component
|
||||||
Components::register("conversations", new conversations());
|
Components::register("conversations", new Conversations());
|
Loading…
Reference in New Issue
Block a user