CoolCMS API

MessageThread extends MessageThread
in package

Private conversation (container).

Messages hang on the thread, not on each other: per-user state (unread / archived / deleted for me) belongs to one participant of the conversation and a message tree would have nowhere to hold it.

Attributes
#[Entity]
#[Table]
$name: 'cms_mod_base_message_threads'
#[TableAlias]
'messageThread'

Table of Contents

Properties

$accessToken  : string|null
$accessTokenValidUntil  : DateTime|null
$closed  : bool
No message can be added to the thread (deleted advert, moderation).
$deleted  : bool
Global (admin) delete. "Deleted for me" is `MessageParticipant::$deleted`.
$id  : int|null
$insertDatetime  : DateTime
$lastMessageDatetime  : DateTime|null
$messageCount  : int
$replyChannel  : MessageReplyChannel
$subject  : string|null
$type  : MessageThreadType|null

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getAccessToken()  : string|null
getAccessTokenValidUntil()  : DateTime|null
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getClosed()  : bool
getDeleted()  : bool
getId()  : int|null
getInsertDatetime()  : DateTime
getLastMessageDatetime()  : DateTime|null
getMessageCount()  : int
getReplyChannel()  : MessageReplyChannel
getSubject()  : string|null
getType()  : MessageThreadType|null
isClosed()  : bool
isDeleted()  : bool
isPersisted()  : bool
isRepliableInSystem()  : bool
Can the thread be replied to directly in the system? (A guest thread offers contact details only.)
setAccessToken()  : $this
setAccessTokenValidUntil()  : $this
setClosed()  : $this
setDeleted()  : $this
setId()  : $this
setInsertDatetime()  : $this
setLastMessageDatetime()  : $this
setMessageCount()  : $this
setReplyChannel()  : $this
setSubject()  : $this
setType()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$accessToken

protected string|null $accessToken = null
Attributes
#[Column]
$name: 'access_token'
$type: 'string'
$length: 64
$nullable: true
#[ExternalReadonly]
#[FieldAccess]
$read: Audience::None
$insert: Audience::None
$update: Audience::None

$accessTokenValidUntil

protected DateTime|null $accessTokenValidUntil = null
Attributes
#[Column]
$name: 'access_token_valid_until'
$type: 'datetime'
$nullable: true
#[ExternalReadonly]

$closed

No message can be added to the thread (deleted advert, moderation).

protected bool $closed = false
Attributes
#[Column]
$name: 'closed'
$type: 'boolean'

$deleted

Global (admin) delete. "Deleted for me" is `MessageParticipant::$deleted`.

protected bool $deleted = false
Attributes
#[Column]
$name: 'deleted'
$type: 'boolean'
#[ExternalReadonly]

$id

protected int|null $id = null
Attributes
#[Column]
$name: 'message_thread_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$insertDatetime

protected DateTime $insertDatetime = new DateTime()
Attributes
#[Column]
$name: 'insert_datetime'
$type: 'datetime'
#[ExternalReadonly]

$lastMessageDatetime

protected DateTime|null $lastMessageDatetime = null
Attributes
#[Column]
$name: 'last_message_datetime'
$type: 'datetime'
$nullable: true
#[ExternalReadonly]

$messageCount

protected int $messageCount = 0
Attributes
#[Column]
$name: 'message_count'
$type: 'integer'
$options: ['unsigned' => true]
#[ExternalReadonly]

$replyChannel

protected MessageReplyChannel $replyChannel = MessageReplyChannel::System
Attributes
#[Column]
$name: 'reply_channel'
$type: 'string'
$length: 16
$enumType: MessageReplyChannel::class

$subject

protected string|null $subject = null
Attributes
#[Column]
$name: 'subject'
$type: 'string'
$length: 255
$nullable: true

$type

protected MessageThreadType|null $type = null
Attributes
#[Column]
$name: 'type'
$type: 'string'
$length: 32
$nullable: true
$enumType: MessageThreadType::class

Methods

__construct()

public __construct([int|null $id = null ][, string|null $subject = null ][, MessageThreadType|null $type = null ][, MessageReplyChannel $replyChannel = MessageReplyChannel::System ][, string|null $accessToken = null ][, DateTime|null $accessTokenValidUntil = null ][, int $messageCount = 0 ][, DateTime|null $lastMessageDatetime = null ][, bool $closed = false ][, DateTime $insertDatetime = new DateTime() ][, bool $deleted = false ]) : mixed
Parameters
$id : int|null = null
$subject : string|null = null
$type : MessageThreadType|null = null
$replyChannel : MessageReplyChannel = MessageReplyChannel::System
$accessToken : string|null = null
$accessTokenValidUntil : DateTime|null = null
$messageCount : int = 0
$lastMessageDatetime : DateTime|null = null
$closed : bool = false
$insertDatetime : DateTime = new DateTime()
$deleted : bool = false

callInitMethods()

Calls `init{TraitName}()` for every used trait that defines such a method.

public callInitMethods() : void

getAccessToken()

public getAccessToken() : string|null
Return values
string|null

getAccessTokenValidUntil()

public getAccessTokenValidUntil() : DateTime|null
Return values
DateTime|null

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>

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getLastMessageDatetime()

public getLastMessageDatetime() : DateTime|null
Return values
DateTime|null

getMessageCount()

public getMessageCount() : int
Return values
int

getSubject()

public getSubject() : string|null
Return values
string|null

isRepliableInSystem()

Can the thread be replied to directly in the system? (A guest thread offers contact details only.)

public isRepliableInSystem() : bool
Return values
bool

setAccessToken()

public setAccessToken(string|null $accessToken) : $this
Parameters
$accessToken : string|null
Return values
$this

setAccessTokenValidUntil()

public setAccessTokenValidUntil(DateTime|null $validUntil) : $this
Parameters
$validUntil : DateTime|null
Return values
$this

setClosed()

public setClosed(bool $closed) : $this
Parameters
$closed : bool
Return values
$this

setDeleted()

public setDeleted(bool $deleted) : $this
Parameters
$deleted : bool
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setInsertDatetime()

public setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
$insertDatetime : DateTime
Return values
$this

setLastMessageDatetime()

public setLastMessageDatetime(DateTime|null $lastMessageDatetime) : $this
Parameters
$lastMessageDatetime : DateTime|null
Return values
$this

setMessageCount()

public setMessageCount(int $messageCount) : $this
Parameters
$messageCount : int
Return values
$this

setSubject()

public setSubject(string|null $subject) : $this
Parameters
$subject : string|null
Return values
$this

getTraitsRecursive()

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>
Return values
array<string, string>
On this page

Search results