CoolCMS API

MessageParticipantView
in package

FinalYes

Thread participant shaped for rendering the detail; not the participant entity.

The Api (:Api:Base:MessageParticipant:myThreadParticipants) returns only what display needs: participant id (assigns authors to messages), "is me" / "guest" flags, display name and a contact carried only by a guest without an account. A registered other party has no e-mail or phone here.

$isFormer means the participant was removed by the manager: they no longer see the thread but their messages stay signed with their name, so the detail must be able to name them. Only participants that are not isFormer belong in the "Participants" list.

$lastReadDatetime is an optional "when the other party last opened the thread": the Api returns it only when the operator enabled message read receipts and only for a foreign registered participant. Disabled, guest or me means null, and null never means "did not read", nothing is shown (see MessageReadState::readMessageIds()).

Table of Contents

Properties

$email  : string|null
$id  : int
$isFormer  : bool
$isGuest  : bool
$isMe  : bool
$lastReadDatetime  : DateTimeImmutable|null
$name  : string
$phone  : string|null

Methods

__construct()  : mixed
fromRow()  : self|null
parseDatetime()  : DateTimeImmutable|null
ISO 8601 from the Api; anything else (missing, `null`, unreadable) yields `null`.

Properties

Methods

__construct()

public __construct(int $id, bool $isMe, bool $isGuest, string $name, string|null $email, string|null $phone[, DateTimeImmutable|null $lastReadDatetime = null ][, bool $isFormer = false ]) : mixed
Parameters
$id : int
$isMe : bool
$isGuest : bool
$name : string
$email : string|null
$phone : string|null
$lastReadDatetime : DateTimeImmutable|null = null
$isFormer : bool = false

fromRow()

public static fromRow(array<string|int, mixed> $row) : self|null
Parameters
$row : array<string|int, mixed>

one item of participants from the Api response

Return values
self|null

parseDatetime()

ISO 8601 from the Api; anything else (missing, `null`, unreadable) yields `null`.

private static parseDatetime(mixed $value) : DateTimeImmutable|null
Parameters
$value : mixed
Return values
DateTimeImmutable|null
On this page

Search results