IComment
in
Interface IComment
This class represents a comment
Tags
Table of Contents
Constants
- MAX_MESSAGE_LENGTH = 1000
Methods
- getActorId() : string
- returns the actor ID
- getActorType() : string
- returns the actor type
- getChildrenCount() : int
- returns the number of children
- getCreationDateTime() : DateTime
- returns the creation date of the comment.
- getExpireDate() : DateTime|null
- Get message expire date
- getId() : string
- returns the ID of the comment
- getLatestChildDateTime() : DateTime
- returns the date of the most recent child
- getMentions() : array<string|int, mixed>
- returns an array containing mentions that are included in the comment
- getMessage() : string
- returns the message of the comment
- getMetaData() : array<string|int, mixed>|null
- Returns the metadata of the comment
- getObjectId() : string
- returns the object id the comment is attached to
- getObjectType() : string
- returns the object type the comment is attached to
- getParentId() : string
- returns the parent ID of the comment
- getReactions() : array<string, int>
- Returns the reactions array if exists
- getReferenceId() : string|null
- returns the reference id of the comment
- getTopmostParentId() : string
- returns the topmost parent ID of the comment
- getVerb() : string
- returns the verb of the comment
- setActor() : IComment
- sets (overwrites) the actor type and id
- setChildrenCount() : IComment
- sets the number of children
- setCreationDateTime() : IComment
- sets the creation date of the comment and returns itself
- setExpireDate() : IComment
- Set message expire date
- setId() : IComment
- sets the ID of the comment and returns itself
- setLatestChildDateTime() : IComment
- sets the date of the most recent child
- setMessage() : IComment
- sets the message of the comment and returns itself
- setMetaData() : IComment
- Sets (overwrites) the metadata of the comment Data as a json encoded array
- setObject() : IComment
- sets (overwrites) the object of the comment
- setParentId() : IComment
- sets the parent ID and returns itself
- setReactions() : IComment
- Set summarized array of reactions by reaction type
- setReferenceId() : IComment
- sets (overwrites) the reference id of the comment
- setTopmostParentId() : IComment
- sets the topmost parent ID and returns itself
- setVerb() : IComment
- sets the verb of the comment, e.g. 'comment' or 'like'
Constants
MAX_MESSAGE_LENGTH
public
mixed
MAX_MESSAGE_LENGTH
= 1000
Tags
Methods
getActorId()
returns the actor ID
public
getActorId() : string
Tags
Return values
stringgetActorType()
returns the actor type
public
getActorType() : string
Tags
Return values
stringgetChildrenCount()
returns the number of children
public
getChildrenCount() : int
Tags
Return values
intgetCreationDateTime()
returns the creation date of the comment.
public
getCreationDateTime() : DateTime
If not explicitly set, it shall default to the time of initialization.
Tags
Return values
DateTimegetExpireDate()
Get message expire date
public
getExpireDate() : DateTime|null
Tags
Return values
DateTime|nullgetId()
returns the ID of the comment
public
getId() : string
It may return an empty string, if the comment was not stored. It is expected that the concrete Comment implementation gives an ID by itself (e.g. after saving).
Tags
Return values
stringgetLatestChildDateTime()
returns the date of the most recent child
public
getLatestChildDateTime() : DateTime
Tags
Return values
DateTimegetMentions()
returns an array containing mentions that are included in the comment
public
getMentions() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —each mention provides a 'type' and an 'id', see example below
getMessage()
returns the message of the comment
public
getMessage() : string
Tags
Return values
stringgetMetaData()
Returns the metadata of the comment
public
getMetaData() : array<string|int, mixed>|null
Tags
Return values
array<string|int, mixed>|nullgetObjectId()
returns the object id the comment is attached to
public
getObjectId() : string
Tags
Return values
stringgetObjectType()
returns the object type the comment is attached to
public
getObjectType() : string
Tags
Return values
stringgetParentId()
returns the parent ID of the comment
public
getParentId() : string
Tags
Return values
stringgetReactions()
Returns the reactions array if exists
public
getReactions() : array<string, int>
The keys is the emoji of reaction and the value is the total.
Tags
Return values
array<string, int> —e.g. ["đź‘Ť":1]
getReferenceId()
returns the reference id of the comment
public
getReferenceId() : string|null
Tags
Return values
string|nullgetTopmostParentId()
returns the topmost parent ID of the comment
public
getTopmostParentId() : string
Tags
Return values
stringgetVerb()
returns the verb of the comment
public
getVerb() : string
Tags
Return values
stringsetActor()
sets (overwrites) the actor type and id
public
setActor(string $actorType, string $actorId) : IComment
Parameters
- $actorType : string
-
e.g. 'users'
- $actorId : string
-
e.g. 'zombie234'
Tags
Return values
ICommentsetChildrenCount()
sets the number of children
public
setChildrenCount(int $count) : IComment
Parameters
- $count : int
Tags
Return values
ICommentsetCreationDateTime()
sets the creation date of the comment and returns itself
public
setCreationDateTime(DateTime $dateTime) : IComment
Parameters
- $dateTime : DateTime
Tags
Return values
ICommentsetExpireDate()
Set message expire date
public
setExpireDate(DateTime|null $dateTime) : IComment
Parameters
- $dateTime : DateTime|null
Tags
Return values
ICommentsetId()
sets the ID of the comment and returns itself
public
setId(string $id) : IComment
It is only allowed to set the ID only, if the current id is an empty string (which means it is not stored in a database, storage or whatever the concrete implementation does), or vice versa. Changing a given ID is not permitted and must result in an IllegalIDChangeException.
Parameters
- $id : string
Tags
Return values
ICommentsetLatestChildDateTime()
sets the date of the most recent child
public
setLatestChildDateTime([DateTime|null $dateTime = null ]) : IComment
Parameters
- $dateTime : DateTime|null = null
Tags
Return values
ICommentsetMessage()
sets the message of the comment and returns itself
public
setMessage(string $message[, int $maxLength = self::MAX_MESSAGE_LENGTH ]) : IComment
When the given message length exceeds MAX_MESSAGE_LENGTH an MessageTooLongException shall be thrown.
Parameters
- $message : string
- $maxLength : int = self::MAX_MESSAGE_LENGTH
Tags
Return values
ICommentsetMetaData()
Sets (overwrites) the metadata of the comment Data as a json encoded array
public
setMetaData(array<string|int, mixed>|null $metaData) : IComment
Parameters
- $metaData : array<string|int, mixed>|null
Tags
Return values
ICommentsetObject()
sets (overwrites) the object of the comment
public
setObject(string $objectType, string $objectId) : IComment
Parameters
- $objectType : string
-
e.g. 'files'
- $objectId : string
-
e.g. '16435'
Tags
Return values
ICommentsetParentId()
sets the parent ID and returns itself
public
setParentId(string $parentId) : IComment
Parameters
- $parentId : string
Tags
Return values
ICommentsetReactions()
Set summarized array of reactions by reaction type
public
setReactions(array<string, int>|null $reactions) : IComment
The keys is the emoji of reaction and the value is the total.
Parameters
- $reactions : array<string, int>|null
-
e.g. ["đź‘Ť":1]
Tags
Return values
ICommentsetReferenceId()
sets (overwrites) the reference id of the comment
public
setReferenceId(string|null $referenceId) : IComment
Parameters
- $referenceId : string|null
-
e.g. sha256 hash sum
Tags
Return values
ICommentsetTopmostParentId()
sets the topmost parent ID and returns itself
public
setTopmostParentId(string $id) : IComment
Parameters
- $id : string
Tags
Return values
ICommentsetVerb()
sets the verb of the comment, e.g. 'comment' or 'like'
public
setVerb(string $verb) : IComment
Parameters
- $verb : string