CoolCMS API

Comment extends BaseEntity
in package
implements OwnerAwareInterface, IdentifiableInterface uses IdentifiableTrait

AbstractYes
Attributes
#[MappedSuperclass]
#[PersonalDataOwner]
'userId'
#[TableAlias]
$alias: 'comment'

Table of Contents

Interfaces

OwnerAwareInterface
Entity that knows who created it (the owner is the author or sender of the record); the named entry point to the generic base of the conditional RBAC role `owner`.
IdentifiableInterface
Entity with a simple integer primary key. Most entities have one (often via {@see \App\Core\Traits\Shared\Models\Entities\IdentifiableTrait}); texts and links with a composite key do not, which is why `getId()` is not on {@see \App\Core\Base\BaseEntity}. Code that needs the id of a generic entity asks for this interface (parameter type, template bound, `instanceof`).

Properties

$active  : bool
$approved  : bool
$deleted  : bool
$id  : int|null
$insertDatetime  : DateTime
$ip  : string
$languageId  : int|null
$parentId  : int|null
$reported  : bool
$text  : string
$threadId  : int
$userEmail  : string|null
$userId  : int|null
$userName  : string

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getActive()  : bool
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getApproved()  : bool
getDeleted()  : bool
getId()  : int|null
getInsertDatetime()  : DateTime
getIp()  : string
getLanguageId()  : int|null
getOwnerUserId()  : int|null
Returns the id of the user who created the record; `null` for an unknown or anonymous owner.
getParentId()  : int|null
getReported()  : bool
getText()  : string
getThreadId()  : int
getUserEmail()  : string|null
getUserId()  : int|null
getUserName()  : string
isActive()  : bool
Visible on the front end? (`deleted = 0 AND approved = 1`, computed by the DB; deliberately no setter.)
isApproved()  : bool
isDeleted()  : bool
isPersisted()  : bool
isReported()  : bool
setApproved()  : $this
setDeleted()  : $this
setId()  : $this
setInsertDatetime()  : $this
setIp()  : $this
setLanguageId()  : $this
setParentId()  : $this
setReported()  : $this
setText()  : $this
setThreadId()  : $this
setUserEmail()  : $this
setUserId()  : $this
setUserName()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$active

protected bool $active = false
Attributes
#[Column]
$name: 'active'
$type: 'boolean'
$nullable: false
$insertable: false
$updatable: false
$options: ['default' => 0]
#[FieldAccess]
$read: Audience::All
$insert: Audience::Privileged
$update: Audience::Privileged

$approved

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

$id

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

$insertDatetime

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

$languageId

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

$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

$reported

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

$text

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

$threadId

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

$userEmail

protected string|null $userEmail = null
Attributes
#[Column]
$type: 'string'
$name: 'user_email'
$length: 255
$nullable: true
#[PersonalData]
PersonalDataKind::Email

$userId

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

$userName

protected string $userName = ''
Attributes
#[Column]
$type: 'string'
$name: 'user_name'
$length: 100

Methods

__construct()

public __construct([int|null $id = null ][, int $threadId = 0 ][, int|null $userId = null ][, int|null $languageId = null ][, int|null $parentId = null ][, string $userName = '' ][, string|null $userEmail = null ][, string $text = '' ][, string $ip = '' ][, DateTime $insertDatetime = new DateTime() ][, bool $approved = false ][, bool $deleted = false ][, bool $reported = false ][, bool $active = false ]) : mixed
Parameters
$id : int|null = null
$threadId : int = 0
$userId : int|null = null
$languageId : int|null = null
$parentId : int|null = null
$userName : string = ''
$userEmail : string|null = null
$text : string = ''
$ip : string = ''
$insertDatetime : DateTime = new DateTime()
$approved : bool = false
$deleted : bool = false
$reported : bool = false
$active : bool = false

callInitMethods()

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

public callInitMethods() : void

getActive()

public getActive() : bool
Return values
bool

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>

getApproved()

public getApproved() : bool
Return values
bool

getDeleted()

public getDeleted() : bool
Return values
bool

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getIp()

public getIp() : string
Return values
string

getLanguageId()

public getLanguageId() : int|null
Return values
int|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

getParentId()

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

getReported()

public getReported() : bool
Return values
bool

getText()

public getText() : string
Return values
string

getThreadId()

public getThreadId() : int
Return values
int

getUserEmail()

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

getUserId()

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

getUserName()

public getUserName() : string
Return values
string

isActive()

Visible on the front end? (`deleted = 0 AND approved = 1`, computed by the DB; deliberately no setter.)

public isActive() : bool
Return values
bool

isApproved()

public isApproved() : bool
Return values
bool

isDeleted()

public isDeleted() : bool
Return values
bool

isReported()

public isReported() : bool
Return values
bool

setApproved()

public setApproved(bool $approved) : $this
Parameters
$approved : 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 $dt) : $this
Parameters
$dt : DateTime
Return values
$this

setIp()

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

setLanguageId()

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

setParentId()

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

setReported()

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

setText()

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

setThreadId()

public setThreadId(int $id) : $this
Parameters
$id : int
Return values
$this

setUserEmail()

public setUserEmail(string|null $email) : $this
Parameters
$email : string|null
Return values
$this

setUserId()

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

setUserName()

public setUserName(string $userName) : $this
Parameters
$userName : string
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