MessageParticipantView
in package
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
$email read-only
public
string|null
$email
$id read-only
public
int
$id
$isFormer read-only
public
bool
$isFormer
= false
$isGuest read-only
public
bool
$isGuest
$isMe read-only
public
bool
$isMe
$lastReadDatetime read-only
public
DateTimeImmutable|null
$lastReadDatetime
= null
$name read-only
public
string
$name
$phone read-only
public
string|null
$phone
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
participantsfrom the Api response
Return values
self|nullparseDatetime()
ISO 8601 from the Api; anything else (missing, `null`, unreadable) yields `null`.
private
static parseDatetime(mixed $value) : DateTimeImmutable|null
Parameters
- $value : mixed