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'
$deleted
protected
bool
$deleted
= false
Attributes
- #[Column]
- $name: 'deleted'
- $type: 'boolean'
$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'
$ip
protected
string
$ip
= ''
Attributes
- #[Column]
- $type: 'string'
- $name: 'ip'
- $length: 45
- #[PersonalData]
- PersonalDataKind::Hidden
$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'
$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]
$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
boolgetAllTraits()
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
boolgetDeleted()
public
getDeleted() : bool
Return values
boolgetId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetIp()
public
getIp() : string
Return values
stringgetLanguageId()
public
getLanguageId() : int|null
Return values
int|nullgetOwnerUserId()
Returns the id of the user who created the record; `null` for an unknown or anonymous owner.
public
getOwnerUserId() : int|null
Return values
int|nullgetParentId()
public
getParentId() : int|null
Return values
int|nullgetReported()
public
getReported() : bool
Return values
boolgetText()
public
getText() : string
Return values
stringgetThreadId()
public
getThreadId() : int
Return values
intgetUserEmail()
public
getUserEmail() : string|null
Return values
string|nullgetUserId()
public
getUserId() : int|null
Return values
int|nullgetUserName()
public
getUserName() : string
Return values
stringisActive()
Visible on the front end? (`deleted = 0 AND approved = 1`, computed by the DB; deliberately no setter.)
public
isActive() : bool
Return values
boolisApproved()
public
isApproved() : bool
Return values
boolisDeleted()
public
isDeleted() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolisReported()
public
isReported() : bool
Return values
boolsetApproved()
public
setApproved(bool $approved) : $this
Parameters
- $approved : bool
Return values
$thissetDeleted()
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 $dt) : $this
Parameters
- $dt : DateTime
Return values
$thissetIp()
public
setIp(string $ip) : $this
Parameters
- $ip : string
Return values
$thissetLanguageId()
public
setLanguageId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetParentId()
public
setParentId(int|null $parentId) : $this
Parameters
- $parentId : int|null
Return values
$thissetReported()
public
setReported(bool $reported) : $this
Parameters
- $reported : bool
Return values
$thissetText()
public
setText(string $text) : $this
Parameters
- $text : string
Return values
$thissetThreadId()
public
setThreadId(int $id) : $this
Parameters
- $id : int
Return values
$thissetUserEmail()
public
setUserEmail(string|null $email) : $this
Parameters
- $email : string|null
Return values
$thissetUserId()
public
setUserId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetUserName()
public
setUserName(string $userName) : $this
Parameters
- $userName : string
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>