ReactionMessage implements RestConvertible, PopupDataAggregatable
Table of Contents
Interfaces
- RestConvertible
- PopupDataAggregatable
- An interface for classes that have entities within them that should be taken to the top level of a REST response.
Constants
Methods
- __construct() : mixed
- addCounter() : self
- addOwnReaction() : self
- addUsers() : self
- getByMessageId() : self
- getMessageId() : int
- getPopupData() : PopupData
- Returns the data to be raised to the top of the REST response. Works on the principle of the composite pattern.
- getRestEntityName() : string
- Returns the name of the entity that will be used in the rest response
- getUserIds() : array<int, int>
- haveDisplayedUsers() : bool
- haveReactions() : bool
- needToFillOwnReactions() : bool
- toRestFormat() : array<string|int, mixed>|null
- Returns an array in JSON like format to return the entity as a rest response.
Constants
COUNT_DISPLAYED_USERS
public
mixed
COUNT_DISPLAYED_USERS
= 5
Methods
__construct()
public
__construct(int $messageId) : mixed
Parameters
- $messageId : int
addCounter()
public
addCounter(string $reaction, int $counter) : self
Parameters
- $reaction : string
- $counter : int
Return values
selfaddOwnReaction()
public
addOwnReaction(string $reaction) : self
Parameters
- $reaction : string
Return values
selfaddUsers()
public
addUsers(string $reaction, array<string|int, mixed> $users) : self
Parameters
- $reaction : string
- $users : array<string|int, mixed>
Return values
selfgetByMessageId()
public
static getByMessageId(int $messageId) : self
Parameters
- $messageId : int
Return values
selfgetMessageId()
public
getMessageId() : int
Return values
intgetPopupData()
Returns the data to be raised to the top of the REST response. Works on the principle of the composite pattern.
public
getPopupData([array<string|int, mixed> $excludedList = [] ]) : PopupData
Parameters
- $excludedList : array<string|int, mixed> = []
Return values
PopupDatagetRestEntityName()
Returns the name of the entity that will be used in the rest response
public
static getRestEntityName() : string
Return values
stringgetUserIds()
public
getUserIds() : array<int, int>
Return values
array<int, int>haveDisplayedUsers()
public
haveDisplayedUsers() : bool
Return values
boolhaveReactions()
public
haveReactions() : bool
Return values
boolneedToFillOwnReactions()
public
needToFillOwnReactions() : bool
Return values
booltoRestFormat()
Returns an array in JSON like format to return the entity as a rest response.
public
toRestFormat([array<string|int, mixed> $option = [] ]) : array<string|int, mixed>|null
Parameters
- $option : array<string|int, mixed> = []