Message
extends Message
in package
One message in a private conversation.
IMPORTANT: the sender is a reference to a participant ($participantId), not a userId plus a
name on the message; otherwise the sender identity would live in two tables and drift apart.
null means a system message.
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_base_messages'
- #[TableAlias]
- 'message'
Table of Contents
Properties
- $deleted : bool
- $id : int|null
- $insertDatetime : DateTime
- $ip : string|null
- $parentId : int|null
- $participantId : int|null
- $text : string
- User input; sanitized on output like comments and discussion.
- $threadId : int
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getDeleted() : bool
- getId() : int|null
- getInsertDatetime() : DateTime
- getIp() : string|null
- getParentId() : int|null
- getParticipantId() : int|null
- getText() : string
- getThreadId() : int
- isDeleted() : bool
- isPersisted() : bool
- isSystem() : bool
- System message (no sender), e.g. an advert was deleted.
- setDeleted() : $this
- setId() : $this
- setInsertDatetime() : $this
- setIp() : $this
- setParentId() : $this
- setParticipantId() : $this
- setText() : $this
- setThreadId() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$deleted
protected
bool
$deleted
= false
Attributes
- #[Column]
- $name: 'deleted'
- $type: 'boolean'
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'message_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$insertDatetime
protected
DateTime
$insertDatetime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_datetime'
- $type: 'datetime'
$ip
protected
string|null
$ip
= null
Attributes
- #[Column]
- $name: 'ip'
- $type: 'string'
- $length: 45
- $nullable: true
- #[PersonalData]
- PersonalDataKind::Hidden
$parentId
protected
int|null
$parentId
= null
Attributes
- #[Column]
- $name: 'parent_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$participantId
protected
int|null
$participantId
= null
Attributes
- #[Column]
- $name: 'cms_mod_base_message_participants_message_participant_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$text
User input; sanitized on output like comments and discussion.
protected
string
$text
= ''
Attributes
- #[Column]
- $name: 'text'
- $type: 'text'
$threadId
protected
int
$threadId
= 0
Attributes
- #[Column]
- $name: 'cms_mod_base_message_threads_message_thread_id'
- $type: 'integer'
- $options: ['unsigned' => true]
Methods
__construct()
public
__construct([int|null $id = null ][, int $threadId = 0 ][, int|null $participantId = null ][, int|null $parentId = null ][, string $text = '' ][, string|null $ip = null ][, DateTime $insertDatetime = new DateTime() ][, bool $deleted = false ]) : mixed
Parameters
- $id : int|null = null
- $threadId : int = 0
- $participantId : int|null = null
- $parentId : int|null = null
- $text : string = ''
- $ip : string|null = null
- $insertDatetime : DateTime = new DateTime()
- $deleted : bool = false
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getDeleted()
public
getDeleted() : bool
Return values
boolgetId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetIp()
public
getIp() : string|null
Return values
string|nullgetParentId()
public
getParentId() : int|null
Return values
int|nullgetParticipantId()
public
getParticipantId() : int|null
Return values
int|nullgetText()
public
getText() : string
Return values
stringgetThreadId()
public
getThreadId() : int
Return values
intisDeleted()
public
isDeleted() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolisSystem()
System message (no sender), e.g. an advert was deleted.
public
isSystem() : bool
Return values
boolsetDeleted()
public
setDeleted(bool $deleted) : $this
Parameters
- $deleted : bool
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertDatetime()
public
setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
- $insertDatetime : DateTime
Return values
$thissetIp()
public
setIp(string|null $ip) : $this
Parameters
- $ip : string|null
Return values
$thissetParentId()
public
setParentId(int|null $parentId) : $this
Parameters
- $parentId : int|null
Return values
$thissetParticipantId()
public
setParticipantId(int|null $participantId) : $this
Parameters
- $participantId : int|null
Return values
$thissetText()
public
setText(string $text) : $this
Parameters
- $text : string
Return values
$thissetThreadId()
public
setThreadId(int $threadId) : $this
Parameters
- $threadId : int
Return values
$thisgetTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>