MotD
in package
implements
CreateableInterface
Uses
Creator, Deletor
Model for the message of the day.
Tags
Interfaces, Classes and Traits
- CreateableInterface
- Interface for createable models.
Table of Contents
- $author : mixed
- $body : mixed
- $creationTime : mixed
- $fillable : array<string|int, mixed>
- $id : mixed
- $systemMessage : mixed
- $title : mixed
- __construct() : mixed
- Constructs an entity and sets default datetime to now.
- create() : CreateableInterface
- Creates and returns an entity instance and fills values.
- delete() : mixed
- Deletes the entity.
- getApparantAuthor() : CharacterInterface
- Returns the appearent author of this message.
- getAuthor() : CharacterInterface
- Returns the character who wrote this motd.
- getBody() : string
- Returns the body of the message.
- getCreationTime() : DateTime
- Returns the creation time. Modification of this has no effect.
- getId() : int
- Returns the entities ID.
- getSystemMessage() : bool
- Returns true if the motd is a system message.
- getTitle() : string
- Returns the title of the message.
- setAuthor() : mixed
- Sets the author of this motd.
- setBody() : mixed
- Sets the body of the message.
- setCreationTime() : mixed
- Sets the creation time. Needs to be set to a new datetime instance.
- setSystemMessage() : mixed
- Set to true of the message should be a system message.
- setTitle() : mixed
- Sets the title of the message.
Properties
$author
private
mixed
$author
Tags
$body
private
mixed
$body
Tags
$creationTime
private
mixed
$creationTime
Tags
$fillable
private
static array<string|int, mixed>
$fillable
= ["author", "title", "body", "systemMessage"]
$id
private
mixed
$id
Tags
$systemMessage
private
mixed
$systemMessage
= false
Tags
$title
private
mixed
$title
Tags
Methods
__construct()
Constructs an entity and sets default datetime to now.
public
__construct() : mixed
Return values
mixed —create()
Creates and returns an entity instance and fills values.
public
static create(array<string|int, mixed> $arguments) : CreateableInterface
Parameters
- $arguments : array<string|int, mixed>
-
The values the instance should get
Tags
Return values
CreateableInterface —The created Entity
delete()
Deletes the entity.
public
delete(EntityManagerInterface $em) : mixed
Parameters
- $em : EntityManagerInterface
Return values
mixed —getApparantAuthor()
Returns the appearent author of this message.
public
getApparantAuthor() : CharacterInterface
Return values
CharacterInterface —getAuthor()
Returns the character who wrote this motd.
public
getAuthor() : CharacterInterface
Returns always the real author of the message, even if it is a system message. Use $this->getSystemMessage() to check if it is a system message or $this->getAppearentAuthor() to get the appearent author.
Return values
CharacterInterface —getBody()
Returns the body of the message.
public
getBody() : string
Return values
string —getCreationTime()
Returns the creation time. Modification of this has no effect.
public
getCreationTime() : DateTime
Return values
DateTime —getId()
Returns the entities ID.
public
getId() : int
Return values
int —getSystemMessage()
Returns true if the motd is a system message.
public
getSystemMessage() : bool
Return values
bool —getTitle()
Returns the title of the message.
public
getTitle() : string
Return values
string —setAuthor()
Sets the author of this motd.
public
setAuthor(Character $author) : mixed
Parameters
- $author : Character
Return values
mixed —setBody()
Sets the body of the message.
public
setBody(string $body) : mixed
Parameters
- $body : string
Return values
mixed —setCreationTime()
Sets the creation time. Needs to be set to a new datetime instance.
public
setCreationTime(DateTime $creationTime) : mixed
Parameters
- $creationTime : DateTime
Return values
mixed —setSystemMessage()
Set to true of the message should be a system message.
public
setSystemMessage([bool $isSystemMessage = true ]) : mixed
Parameters
- $isSystemMessage : bool = true
Return values
mixed —setTitle()
Sets the title of the message.
public
setTitle(string $title) : mixed
Parameters
- $title : string