CoolCMS API

WorkItemComment extends WorkItemComment
in package

Comment on a work item, stored in a flat table instead of a shared `CommentThread`.

Attributes
#[Entity]
#[Table]
$name: 'cms_mod_company_work_item_comments'
#[TableAlias]
'workItemComment'

Table of Contents

Properties

$authorName  : string
$byClient  : bool
$deleted  : bool
$id  : int|null
$insertDatetime  : DateTime
$ip  : string|null
$readDatetime  : DateTime|null
$text  : string
$userId  : int|null
$workItemId  : 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.
getAuthorName()  : string
getId()  : int|null
getInsertDatetime()  : DateTime
getIp()  : string|null
getOwnerUserId()  : int|null
Returns the id of the user who created the record; `null` for an unknown or anonymous owner.
getReadDatetime()  : DateTime|null
getText()  : string
getUserId()  : int|null
getWorkItemId()  : int
isByClient()  : bool
isDeleted()  : bool
isPersisted()  : bool
isUnread()  : bool
Returns whether the other side has not seen the comment yet.
setAuthorName()  : $this
setByClient()  : $this
setDeleted()  : $this
setId()  : $this
setInsertDatetime()  : $this
setIp()  : $this
setReadDatetime()  : $this
setText()  : $this
setUserId()  : $this
setWorkItemId()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$id

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

$insertDatetime

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

$readDatetime

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

$text

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

$userId

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

$workItemId

protected int $workItemId = 0
Attributes
#[Column]
$name: 'work_item_id'
$type: 'integer'
$options: ['unsigned' => true]

Methods

__construct()

public __construct([int|null $id = null ][, int $workItemId = 0 ][, int|null $userId = null ][, bool $byClient = false ][, string $authorName = '' ][, string $text = '' ][, string|null $ip = null ][, DateTime $insertDatetime = new DateTime() ][, DateTime|null $readDatetime = null ][, bool $deleted = false ]) : mixed
Parameters
$id : int|null = null
$workItemId : int = 0
$userId : int|null = null
$byClient : bool = false
$authorName : string = ''
$text : string = ''
$ip : string|null = null
$insertDatetime : DateTime = new DateTime()
$readDatetime : DateTime|null = null
$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>

getAuthorName()

public getAuthorName() : string
Return values
string

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

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

getReadDatetime()

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

isUnread()

Returns whether the other side has not seen the comment yet.

public isUnread() : bool
Return values
bool

setAuthorName()

public setAuthorName(string $authorName) : $this
Parameters
$authorName : string
Return values
$this

setByClient()

public setByClient(bool $byClient) : $this
Parameters
$byClient : 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

setIp()

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

setReadDatetime()

public setReadDatetime(DateTime|null $readDatetime) : $this
Parameters
$readDatetime : DateTime|null
Return values
$this

setText()

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

setUserId()

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

setWorkItemId()

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