CoolCMS API

MessageSystemEvent : string
in package

Event in a thread written as a system message (`participant_id = NULL`): someone joined / left the conversation.

IMPORTANT: the message text in the DB is a code, not a sentence: [[system:joined:<participantId>]]. People with different languages read the conversation and the name must be current; a sentence stored in the manager's language would be foreign to the others. Templates (front end and admin) recognize the code via self::decode() and render a translated sentence with the participant's name; an unrecognized system message is printed as plain text. The code never goes into e-mail (system messages are not notified).

Table of Contents

Cases

Joined  = 'joined'
Left  = 'left'

Methods

decode()  : array{event: self, participantId: int}|null
Recognizes the text of a system message.
encode()  : string
Text of a system message for an event with the given participant (row in `message_participants`).

Cases

Methods

decode()

Recognizes the text of a system message.

public static decode(string|null $text) : array{event: self, participantId: int}|null
Parameters
$text : string|null
Return values
array{event: self, participantId: int}|null —

null = plain text

encode()

Text of a system message for an event with the given participant (row in `message_participants`).

public encode(int $participantId) : string
Parameters
$participantId : int
Return values
string
On this page

Search results