IComment
Interface IComment
This class represents a comment
Tags
Table of Contents
- MAX_MESSAGE_LENGTH = 1000
- 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.
- getId() : string
- returns the ID of the comment
- getLatestChildDateTime() : DateTime
- returns the date of the most recent child
- getMentions() : array
- returns an array containing mentions that are included in the comment
- getMessage() : string
- returns the message 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
- 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
- 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
- setObject() : IComment
- sets (overwrites) the object of the comment
- setParentId() : IComment
- sets the parent ID and returns itself
- 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
Methods
getActorId()
returns the actor ID
public
getActorId() : string
Tags
Return values
string —getActorType()
returns the actor type
public
getActorType() : string
Tags
Return values
string —getChildrenCount()
returns the number of children
public
getChildrenCount() : int
Tags
Return values
int —getCreationDateTime()
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
DateTime —getId()
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
string —getLatestChildDateTime()
returns the date of the most recent child
public
getLatestChildDateTime() : DateTime
Tags
Return values
DateTime —getMentions()
returns an array containing mentions that are included in the comment
public
getMentions() : array
Tags
Return values
array —each mention provides a 'type' and an 'id', see example below
getMessage()
returns the message of the comment
public
getMessage() : string
Tags
Return values
string —getObjectId()
returns the object id the comment is attached to
public
getObjectId() : string
Tags
Return values
string —getObjectType()
returns the object type the comment is attached to
public
getObjectType() : string
Tags
Return values
string —getParentId()
returns the parent ID of the comment
public
getParentId() : string
Tags
Return values
string —getTopmostParentId()
returns the topmost parent ID of the comment
public
getTopmostParentId() : string
Tags
Return values
string —getVerb()
returns the verb of the comment
public
getVerb() : string
Tags
Return values
string —setActor()
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
IComment —setChildrenCount()
sets the number of children
public
setChildrenCount(int $count) : IComment
Parameters
- $count : int
Tags
Return values
IComment —setCreationDateTime()
sets the creation date of the comment and returns itself
public
setCreationDateTime(DateTime $dateTime) : IComment
Parameters
- $dateTime : DateTime
Tags
Return values
IComment —setId()
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
IComment —setLatestChildDateTime()
sets the date of the most recent child
public
setLatestChildDateTime(DateTime $dateTime) : IComment
Parameters
- $dateTime : DateTime
Tags
Return values
IComment —setMessage()
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
IComment —setObject()
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
IComment —setParentId()
sets the parent ID and returns itself
public
setParentId(string $parentId) : IComment
Parameters
- $parentId : string
Tags
Return values
IComment —setTopmostParentId()
sets the topmost parent ID and returns itself
public
setTopmostParentId(string $id) : IComment
Parameters
- $id : string
Tags
Return values
IComment —setVerb()
sets the verb of the comment, e.g. 'comment' or 'like'
public
setVerb(string $verb) : IComment
Parameters
- $verb : string