Message
in package
Model for messages.
Tags
Table of Contents
- $author : mixed
- $createdAt : mixed
- $id : mixed
- $message : mixed
- $systemMessage : mixed
- $thread : mixed
- __construct() : mixed
- Constructs the message.
- getApparantAuthor() : CharacterInterface
- Returns the apparant character of the message.
- getAuthor() : CharacterInterface
- Returns the true character of the message.
- getCreatedAt() : DateTime
- Returns the datetime this message was created at.
- getId() : int
- Returns the id.
- getMessage() : string
- Returns the message.
- getThread() : MessageThread
- Returns the thread this message belongs to.
- isSystemMessage() : bool
- Returns true if the message is a system message.
- setThread() : mixed
- Sets the thread this message belongs to, once.
Properties
$author
private
mixed
$author
Tags
$createdAt
private
mixed
$createdAt
Tags
$id
private
mixed
$id
Tags
$message
private
mixed
$message
Tags
$systemMessage
private
mixed
$systemMessage
= false
Tags
$thread
private
mixed
$thread
Tags
Methods
__construct()
Constructs the message.
public
__construct(CharacterInterface $from, string $message, MessageThread $thread, bool $systemMessage) : mixed
Use the Message Manager methods send() and sendSystemMessage() instead.
Parameters
- $from : CharacterInterface
- $message : string
- $thread : MessageThread
- $systemMessage : bool
Tags
Return values
mixed —getApparantAuthor()
Returns the apparant character of the message.
public
getApparantAuthor() : CharacterInterface
If a character sends a system message, this method will return the SystemCharacter message instead of the true author.
Return values
CharacterInterface —getAuthor()
Returns the true character of the message.
public
getAuthor() : CharacterInterface
Return values
CharacterInterface —getCreatedAt()
Returns the datetime this message was created at.
public
getCreatedAt() : DateTime
Return values
DateTime —getId()
Returns the id.
public
getId() : int
Return values
int —getMessage()
Returns the message.
public
getMessage() : string
Return values
string —getThread()
Returns the thread this message belongs to.
public
getThread() : MessageThread
Return values
MessageThread —isSystemMessage()
Returns true if the message is a system message.
public
isSystemMessage() : bool
Return values
bool —setThread()
Sets the thread this message belongs to, once.
public
setThread(MessageThread $thread) : mixed
A message that belongs to a thread needs to stay there - there is no need for messages to switch the thread and end up in a complete different discussion.
Parameters
- $thread : MessageThread