Documentation

Message
in package

Model for messages.

Tags
Entity
Table

(name="messages")

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
ManyToOne

(targetEntity="Character", fetch="EAGER")

JoinColumn

(name="author_id", referencedColumnName="id", nullable=true)

$createdAt

private mixed $createdAt
Tags
Column

(type="datetime", nullable=false)

$id

private mixed $id
Tags
Id

@Column(type="integer") @GeneratedValue

$message

private mixed $message
Tags
Column

(type="text", nullable=false)

$systemMessage

private mixed $systemMessage = false
Tags
Column

(type="boolean", nullable=false)

$thread

private mixed $thread
Tags
ManyToOne

(targetEntity="MessageThread", inversedBy="messages", fetch="EAGER")

Methods

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

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

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
Tags
throws
ParentAlreadySetException
Return values
mixed

Search results