Menu

## Message
in package

Message.php : 19

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

Message.php : 27
`private mixed $author`

##### Tags

ManyToOne

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

JoinColumn

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

#### $createdAt

Message.php : 33
`private mixed $createdAt`

##### Tags

Column

  (type="datetime", nullable=false)

#### $id

Message.php : 22
`private mixed $id`

##### Tags

Id

  @Column(type="integer") @GeneratedValue

#### $message

Message.php : 29
`private mixed $message`

##### Tags

Column

  (type="text", nullable=false)

#### $systemMessage

Message.php : 35
`private mixed $systemMessage = false`

##### Tags

Column

  (type="boolean", nullable=false)

#### $thread

Message.php : 31
`private mixed $thread`

##### Tags

ManyToOne

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

### Methods

#### __construct()

Message.php : 46

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

throws
  ArgumentException

##### Return values

mixed —

#### getApparantAuthor()

Message.php : 97

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()

Message.php : 82

Returns the true character of the message.

`public getAuthor() : CharacterInterface`

##### Return values

CharacterInterface —

#### getCreatedAt()

Message.php : 144

Returns the datetime this message was created at.

`public getCreatedAt() : DateTime`

##### Return values

DateTime —

#### getId()

Message.php : 73

Returns the id.

`public getId() : int`

##### Return values

int —

#### getMessage()

Message.php : 109

Returns the message.

`public getMessage() : string`

##### Return values

string —

#### getThread()

Message.php : 118

Returns the thread this message belongs to.

`public getThread() : MessageThread`

##### Return values

MessageThread —

#### isSystemMessage()

Message.php : 153

Returns true if the message is a system message.

`public isSystemMessage() : bool`

##### Return values

bool —

#### setThread()

Message.php : 131

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