CoolCMS API

Message extends Message
in package

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_discussion_messages'
#[TableAlias]
'message'

Table of Contents

Properties

$activationKey  : string|null
$approvedAt  : DateTime|null
$asset  : TImage|null
$assetRels  : Collection
$assets  : array<int, TImage>
$banned  : bool
$categories  : Collection<int, Category>
$commentThread  : mixed
$commentThreadId  : int|null
$confirmedAt  : DateTime|null
$deactivated  : bool
$deleted  : bool
$email  : string
$externalUrl  : string|null
$firstParentId  : int|null
$id  : int|null
$insertDatetime  : DateTime
$ip  : string|null
$level  : int
$lft  : int
$manageKeyExpires  : DateTime|null
$manageKeyHash  : string|null
$paid  : bool
$parentId  : int|null
$password  : string
$ratingThread  : TRatingThread|null
$reported  : bool
$rgt  : int
$showComments  : bool
$subject  : string
$text  : string
$topedUntil  : DateTime|null
$userId  : int|null
$username  : string|null
$viewsDetail  : int
$viewsList  : int
$votesDown  : int
$votesUp  : int

Methods

__construct()  : mixed
addAssetRel()  : $this
addCategory()  : $this
assetRelCollectionInit()  : void
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
categoryCollectionInit()  : void
clearCategories()  : $this
getActivationKey()  : string|null
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getApprovedAt()  : DateTime|null
getAsset()  : TImage|null
getAssetRels()  : Collection<int, TAssetRel>
getAssets()  : array<int, mixed>
Assets of the non-removed rels, ordered by `order` — whatever the rel's untyped `getAsset()` holds (asset entity, or null).
getBanned()  : bool
getCategories()  : Collection<int, TCategory>
getCategoryIds()  : array<string|int, int>
getCommentsCount()  : int
getCommentThread()  : TCommentThread|null
getCommentThreadId()  : int|null
getConfirmedAt()  : DateTime|null
getDeactivated()  : bool
getDeleted()  : bool
getEmail()  : string
getExternalUrl()  : string|null
getFirstCategoryId()  : int|null
getFirstParentId()  : int|null
getId()  : int|null
getInsertDatetime()  : DateTime
getIp()  : string|null
getLevel()  : int
getLft()  : int
getMainAsset()  : Asset|null
getManageKeyExpires()  : DateTime|null
getManageKeyHash()  : string|null
getOwnerUserId()  : int|null
Returns the id of the user who created the record; `null` for an unknown or anonymous owner.
getPaid()  : bool
getParentId()  : int|null
getPassword()  : string
Password hash (or the random secret of a guest post) the key is bound to; empty = no key can be issued.
getRatingThread()  : TRatingThread|null
getRatingThreadId()  : int|null
getReported()  : bool
getRgt()  : int
getShowComments()  : bool
getSubject()  : string
getText()  : string
getTopedUntil()  : DateTime|null
getUserId()  : int|null
getUsername()  : string|null
getViewsDetail()  : int
getViewsList()  : int
getVotesDown()  : int
getVotesUp()  : int
isApproved()  : bool
isBanned()  : bool
isConfirmed()  : bool
isDeactivated()  : bool
isDeleted()  : bool
isPaid()  : bool
isPersisted()  : bool
isReported()  : bool
isShowComments()  : bool
isToped()  : bool
Whether topping is in effect now; the same rule as the list order `topedUntil > NOW()` (as `Advert::isToped()`).
removeAssetRel()  : $this
removeCategory()  : $this
setActivationKey()  : $this
setApprovedAt()  : $this
setAsset()  : $this
setAssetRels()  : $this
IMPORTANT: the parameter type must be `Collection`, not `ArrayCollection`; the keep branch of the Api `SaveTrait` can pass a `PersistentCollection` from a managed entity, and a narrower type would throw a `TypeError` and fail the save.
setBanned()  : $this
setCategories()  : $this
setCommentThread()  : $this
setCommentThreadId()  : $this
setConfirmedAt()  : $this
setDeactivated()  : $this
setDeleted()  : $this
setEmail()  : $this
setExternalUrl()  : $this
setFirstParentId()  : $this
setId()  : $this
setInsertDatetime()  : $this
setIp()  : $this
setLevel()  : $this
setLft()  : $this
setManageKeyExpires()  : $this
setManageKeyHash()  : $this
setPaid()  : $this
setParentId()  : $this
setPassword()  : $this
setRatingThread()  : $this
setReported()  : $this
setRgt()  : $this
setShowComments()  : $this
setSubject()  : $this
setText()  : $this
setTopedUntil()  : $this
setUserId()  : $this
setUsername()  : $this
setViewsDetail()  : $this
setViewsList()  : $this
setVotesDown()  : $this
setVotesUp()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$activationKey

protected string|null $activationKey = null
Attributes
#[Column]
$name: 'activation_key'
$type: 'string'
$length: 64
$nullable: true
#[ExternalReadonly]
#[FieldAccess]
$read: Audience::Internal
$insert: Audience::All
$update: Audience::All

$approvedAt

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

$asset

protected TImage|null $asset = null
Attributes
#[FieldAccess]
$read: \App\Core\Attributes\Hydration\Audience::All
$insert: \App\Core\Attributes\Hydration\Audience::Privileged
$update: \App\Core\Attributes\Hydration\Audience::Privileged
#[JoinColumn]
$name: 'cms_system_images_image_id'
$referencedColumnName: 'image_id'
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Api\System\Models\Entities\Asset::class

$assetRels

protected Collection $assetRels
Attributes
#[OneToMany]
$targetEntity: \App\UI\Api\Discussion\Models\Entities\MessageAssetRel::class
$mappedBy: 'message'
$cascade: ["persist", "remove"]
$orphanRemoval: true
$fetch: "LAZY"

$categories

protected Collection<int, Category> $categories
Attributes
#[JoinTable]
$name: 'cms_mod_discussion_message_category_relations'
$joinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_discussion_messages_message_id', referencedColumnName: 'message_id', onDelete: 'CASCADE')]
$inverseJoinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_discussion_categories_category_id', referencedColumnName: 'category_id', onDelete: 'CASCADE')]
#[ManyToMany]
$targetEntity: \App\UI\Api\Discussion\Models\Entities\Category::class
$fetch: "LAZY"

$commentThread

protected mixed $commentThread = null
Attributes
#[FieldAccess]
$read: \App\Core\Attributes\Hydration\Audience::All
$insert: \App\Core\Attributes\Hydration\Audience::Privileged
$update: \App\Core\Attributes\Hydration\Audience::Privileged
#[JoinColumn]
$name: 'cms_mod_base_comment_threads_comment_thread_id'
$referencedColumnName: 'comment_thread_id'
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Api\Base\Models\Entities\CommentThread::class

$commentThreadId

protected int|null $commentThreadId = null
Attributes
#[FieldAccess]
$read: \App\Core\Attributes\Hydration\Audience::All
$insert: \App\Core\Attributes\Hydration\Audience::Privileged
$update: \App\Core\Attributes\Hydration\Audience::Privileged
#[Transient]

$confirmedAt

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

$deactivated

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

$deleted

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

$email

protected string $email = ''
Attributes
#[Column]
$name: 'email'
$type: 'string'
$length: 255
#[PersonalData]
PersonalDataKind::Email

$externalUrl

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

$firstParentId

protected int|null $firstParentId = null
Attributes
#[Column]
$name: 'first_parent_id'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]
#[FieldAccess]
$read: Audience::All
$insert: Audience::Privileged
$update: Audience::Privileged

$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'
#[ExternalReadonly]

$level

protected int $level = 1
Attributes
#[Column]
$name: 'level'
$type: 'integer'
$options: ['unsigned' => true]
#[FieldAccess]
$read: Audience::All
$insert: Audience::Privileged
$update: Audience::Privileged

$lft

protected int $lft = 0
Attributes
#[Column]
$name: 'lft'
$type: 'integer'
$options: ['unsigned' => true]
#[FieldAccess]
$read: Audience::All
$insert: Audience::Privileged
$update: Audience::Privileged

$manageKeyExpires

protected DateTime|null $manageKeyExpires = null
Attributes
#[Column]
$name: 'manage_key_expires'
$type: 'datetime'
$nullable: true
#[ExternalReadonly]
#[FieldAccess]
$read: Audience::None
$insert: Audience::None
$update: Audience::None

$manageKeyHash

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

$paid

protected bool $paid = true
Attributes
#[Column]
$name: 'paid'
$type: 'boolean'
$options: ['default' => true]
#[ExternalReadonly]

$parentId

protected int|null $parentId = null
Attributes
#[Column]
$name: 'parent_id'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]
#[FieldAccess]
$read: Audience::All
$insert: Audience::All
$update: Audience::Privileged

$password

protected string $password = ''
Attributes
#[Column]
$name: 'password'
$type: 'string'
$length: 80
#[FieldAccess]
$read: Audience::Internal
$insert: Audience::All
$update: Audience::All

$ratingThread

protected TRatingThread|null $ratingThread = null
Attributes
#[FieldAccess]
$read: \App\Core\Attributes\Hydration\Audience::All
$insert: \App\Core\Attributes\Hydration\Audience::Privileged
$update: \App\Core\Attributes\Hydration\Audience::Privileged
#[JoinColumn]
$name: 'cms_mod_base_rating_threads_rating_thread_id'
$referencedColumnName: 'rating_thread_id'
$nullable: true
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Api\Base\Models\Entities\RatingThread::class

$rgt

protected int $rgt = 0
Attributes
#[Column]
$name: 'rgt'
$type: 'integer'
$options: ['unsigned' => true]
#[FieldAccess]
$read: Audience::All
$insert: Audience::Privileged
$update: Audience::Privileged

$showComments

protected bool $showComments = true
Attributes
#[Column]
$name: 'show_comments'
$type: 'boolean'

$subject

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

$text

protected string $text = ''
Attributes
#[Column]
$name: 'text'
$type: 'text'

$topedUntil

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

$userId

protected int|null $userId = null
Attributes
#[Column]
$name: 'cms_system_users_user_id'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]
#[ExternalReadonly]

$username

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

$viewsDetail

protected int $viewsDetail = 0
Attributes
#[Column]
$name: 'views_detail'
$type: 'bigint'
#[ExternalReadonly]

$viewsList

protected int $viewsList = 0
Attributes
#[Column]
$name: 'views_list'
$type: 'bigint'
#[ExternalReadonly]

$votesDown

protected int $votesDown = 0
Attributes
#[Column]
$name: 'votes_down'
$type: 'bigint'
$options: ['unsigned' => true]
#[ExternalReadonly]

$votesUp

protected int $votesUp = 0
Attributes
#[Column]
$name: 'votes_up'
$type: 'bigint'
$options: ['unsigned' => true]
#[ExternalReadonly]

Methods

__construct()

public __construct([int|null $id = null ][, int|null $parentId = null ][, int $lft = 0 ][, int $rgt = 0 ][, int $level = 1 ][, int|null $userId = null ][, string|null $username = null ][, string $email = '' ][, string $password = '' ][, string $subject = '' ][, string $text = '' ][, string|null $ip = null ][, DateTime $insertDatetime = new DateTime() ][, DateTime|null $topedUntil = null ][, int $votesUp = 0 ][, int $votesDown = 0 ][, int $viewsList = 0 ][, int $viewsDetail = 0 ][, bool $banned = false ][, bool $deactivated = false ][, bool $deleted = false ][, bool $paid = true ][, DateTime|null $approvedAt = null ][, DateTime|null $confirmedAt = null ][, string|null $activationKey = null ][, string|null $manageKeyHash = null ][, DateTime|null $manageKeyExpires = null ][, int|null $firstParentId = null ][, bool $reported = false ][, bool $showComments = true ][, string|null $externalUrl = null ][, mixed $asset = null ][, Collection $assetRels = new ArrayCollection() ][, Collection $categories = new ArrayCollection() ]) : mixed
Parameters
$id : int|null = null
$parentId : int|null = null
$lft : int = 0
$rgt : int = 0
$level : int = 1
$userId : int|null = null
$username : string|null = null
$email : string = ''
$password : string = ''
$subject : string = ''
$text : string = ''
$ip : string|null = null
$insertDatetime : DateTime = new DateTime()
$topedUntil : DateTime|null = null
$votesUp : int = 0
$votesDown : int = 0
$viewsList : int = 0
$viewsDetail : int = 0
$banned : bool = false
$deactivated : bool = false
$deleted : bool = false
$paid : bool = true
$approvedAt : DateTime|null = null
$confirmedAt : DateTime|null = null
$activationKey : string|null = null
$manageKeyHash : string|null = null
$manageKeyExpires : DateTime|null = null
$firstParentId : int|null = null
$reported : bool = false
$showComments : bool = true
$externalUrl : string|null = null
$asset : mixed = null
$assetRels : Collection = new ArrayCollection()
$categories : Collection = new ArrayCollection()

addAssetRel()

public addAssetRel(TAssetRel $assetRel) : $this
Parameters
$assetRel : TAssetRel
Return values
$this

addCategory()

public addCategory(TCategory $category) : $this
Parameters
$category : TCategory
Return values
$this

callInitMethods()

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

public callInitMethods() : void

getActivationKey()

public getActivationKey() : string|null
Return values
string|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>

getApprovedAt()

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

getAsset()

public getAsset() : TImage|null
Return values
TImage|null

getAssetRels()

public getAssetRels() : Collection<int, TAssetRel>
Return values
Collection<int, TAssetRel>

getAssets()

Assets of the non-removed rels, ordered by `order` — whatever the rel's untyped `getAsset()` holds (asset entity, or null).

public getAssets() : array<int, mixed>
Return values
array<int, mixed>

getBanned()

public getBanned() : bool
Return values
bool

getCategories()

public getCategories() : Collection<int, TCategory>
Return values
Collection<int, TCategory>

getCategoryIds()

public getCategoryIds() : array<string|int, int>
Return values
array<string|int, int>

getCommentsCount()

public getCommentsCount() : int
Return values
int

getCommentThread()

public getCommentThread() : TCommentThread|null
Return values
TCommentThread|null

getCommentThreadId()

public getCommentThreadId() : int|null
Return values
int|null

getConfirmedAt()

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

getDeactivated()

public getDeactivated() : bool
Return values
bool

getDeleted()

public getDeleted() : bool
Return values
bool

getEmail()

public getEmail() : string
Return values
string

getExternalUrl()

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

getFirstParentId()

public getFirstParentId() : int|null
Return values
int|null

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getIp()

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

getLevel()

public getLevel() : int
Return values
int

getLft()

public getLft() : int
Return values
int

getManageKeyExpires()

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

getManageKeyHash()

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

getOwnerUserId()

Returns the id of the user who created the record; `null` for an unknown or anonymous owner.

public getOwnerUserId() : int|null
Return values
int|null

getPaid()

public getPaid() : bool
Return values
bool

getParentId()

public getParentId() : int|null
Return values
int|null

getPassword()

Password hash (or the random secret of a guest post) the key is bound to; empty = no key can be issued.

public getPassword() : string
Return values
string

getRatingThread()

public getRatingThread() : TRatingThread|null
Return values
TRatingThread|null

getRatingThreadId()

public getRatingThreadId() : int|null
Return values
int|null

getReported()

public getReported() : bool
Return values
bool

getRgt()

public getRgt() : int
Return values
int

getShowComments()

public getShowComments() : bool
Return values
bool

getSubject()

public getSubject() : string
Return values
string

getText()

public getText() : string
Return values
string

getTopedUntil()

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

getUserId()

public getUserId() : int|null
Return values
int|null

getUsername()

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

getViewsDetail()

public getViewsDetail() : int
Return values
int

getViewsList()

public getViewsList() : int
Return values
int

getVotesDown()

public getVotesDown() : int
Return values
int

getVotesUp()

public getVotesUp() : int
Return values
int

isApproved()

public isApproved() : bool
Return values
bool

isBanned()

public isBanned() : bool
Return values
bool

isConfirmed()

public isConfirmed() : bool
Return values
bool

isDeactivated()

public isDeactivated() : bool
Return values
bool

isDeleted()

public isDeleted() : bool
Return values
bool

isPaid()

public isPaid() : bool
Return values
bool

isReported()

public isReported() : bool
Return values
bool

isShowComments()

public isShowComments() : bool
Return values
bool

isToped()

Whether topping is in effect now; the same rule as the list order `topedUntil > NOW()` (as `Advert::isToped()`).

public isToped() : bool
Return values
bool

removeAssetRel()

public removeAssetRel(TAssetRel $assetRel) : $this
Parameters
$assetRel : TAssetRel
Return values
$this

removeCategory()

public removeCategory(TCategory $category) : $this
Parameters
$category : TCategory
Return values
$this

setActivationKey()

public setActivationKey(string|null $activationKey) : $this
Parameters
$activationKey : string|null
Return values
$this

setApprovedAt()

public setApprovedAt(DateTime|null $approvedAt) : $this
Parameters
$approvedAt : DateTime|null
Return values
$this

setAsset()

public setAsset(TImage|null $asset) : $this
Parameters
$asset : TImage|null
Return values
$this

setAssetRels()

IMPORTANT: the parameter type must be `Collection`, not `ArrayCollection`; the keep branch of the Api `SaveTrait` can pass a `PersistentCollection` from a managed entity, and a narrower type would throw a `TypeError` and fail the save.

public setAssetRels(Collection<int, TAssetRel> $assetRels) : $this
Parameters
$assetRels : Collection<int, TAssetRel>
Return values
$this

setBanned()

public setBanned(bool $banned) : $this
Parameters
$banned : bool
Return values
$this

setCategories()

public setCategories(Collection<int, TCategory>|array<int, TCategory> $categories) : $this
Parameters
$categories : Collection<int, TCategory>|array<int, TCategory>
Return values
$this

setCommentThread()

public setCommentThread(TCommentThread|null $commentThread) : $this
Parameters
$commentThread : TCommentThread|null
Return values
$this

setCommentThreadId()

public setCommentThreadId(int|null $commentThreadId) : $this
Parameters
$commentThreadId : int|null
Return values
$this

setConfirmedAt()

public setConfirmedAt(DateTime|null $confirmedAt) : $this
Parameters
$confirmedAt : DateTime|null
Return values
$this

setDeactivated()

public setDeactivated(bool $deactivated) : $this
Parameters
$deactivated : bool
Return values
$this

setDeleted()

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

setEmail()

public setEmail(string $email) : $this
Parameters
$email : string
Return values
$this

setExternalUrl()

public setExternalUrl(string|null $url) : $this
Parameters
$url : string|null
Return values
$this

setFirstParentId()

public setFirstParentId(int|null $firstParentId) : $this
Parameters
$firstParentId : int|null
Return values
$this

setId()

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

setInsertDatetime()

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

setIp()

public setIp(string|null $ip) : $this
Parameters
$ip : string|null
Return values
$this

setLevel()

public setLevel(int $level) : $this
Parameters
$level : int
Return values
$this

setLft()

public setLft(int $lft) : $this
Parameters
$lft : int
Return values
$this

setManageKeyExpires()

public setManageKeyExpires(DateTime|null $manageKeyExpires) : $this
Parameters
$manageKeyExpires : DateTime|null
Return values
$this

setManageKeyHash()

public setManageKeyHash(string|null $manageKeyHash) : $this
Parameters
$manageKeyHash : string|null
Return values
$this

setPaid()

public setPaid(bool $paid) : $this
Parameters
$paid : bool
Return values
$this

setParentId()

public setParentId(int|null $parentId) : $this
Parameters
$parentId : int|null
Return values
$this

setPassword()

public setPassword(string $password) : $this
Parameters
$password : string
Return values
$this

setRatingThread()

public setRatingThread(TRatingThread|null $ratingThread) : $this
Parameters
$ratingThread : TRatingThread|null
Return values
$this

setReported()

public setReported(bool $reported) : $this
Parameters
$reported : bool
Return values
$this

setRgt()

public setRgt(int $rgt) : $this
Parameters
$rgt : int
Return values
$this

setShowComments()

public setShowComments(bool $show) : $this
Parameters
$show : bool
Return values
$this

setSubject()

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

setText()

public setText(string $text) : $this
Parameters
$text : string
Return values
$this

setTopedUntil()

public setTopedUntil(DateTime|null $dt) : $this
Parameters
$dt : DateTime|null
Return values
$this

setUserId()

public setUserId(int|null $userId) : $this
Parameters
$userId : int|null
Return values
$this

setUsername()

public setUsername(string|null $username) : $this
Parameters
$username : string|null
Return values
$this

setViewsDetail()

public setViewsDetail(int $views) : $this
Parameters
$views : int
Return values
$this

setViewsList()

public setViewsList(int $views) : $this
Parameters
$views : int
Return values
$this

setVotesDown()

public setVotesDown(int $votes) : $this
Parameters
$votes : int
Return values
$this

setVotesUp()

public setVotesUp(int $votes) : $this
Parameters
$votes : int
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