IComment¶
-
interface
OCP\Comments\
IComment
¶ - Interface ICommentThis class represents a comment
Implemented by: OC\Comments\Comment
Source: lib/public/Comments/IComment.php#36
Constants¶
-
MAX_MESSAGE_LENGTH = 1000
Source: lib/public/Comments/IComment.php#37
Methods¶
-
public
OCP\Comments\IComment::
getId
()¶ - returns the ID of the commentIt may return an empty string, if the comment was not stored.It is expected that the concrete Comment implementation gives an IDby itself (e.g. after saving).
Source: lib/public/Comments/IComment.php#49 Returns: string Since: 9.0.0
-
public
OCP\Comments\IComment::
setId
($id)¶ - sets the ID of the comment and returns itselfIt is only allowed to set the ID only, if the current id is an emptystring (which means it is not stored in a database, storage or whateverthe concrete implementation does), or vice versa. Changing a given ID isnot permitted and must result in an IllegalIDChangeException.
Source: Parameters: - $id (string)
Returns: Throws: Since: 9.0.0
-
public
OCP\Comments\IComment::
getParentId
()¶ - returns the parent ID of the comment
Source: lib/public/Comments/IComment.php#72 Returns: string Since: 9.0.0
-
public
OCP\Comments\IComment::
setParentId
($parentId)¶ - sets the parent ID and returns itself
Source: Parameters: - $parentId (string)
Returns: Since: 9.0.0
-
public
OCP\Comments\IComment::
getTopmostParentId
()¶ - returns the topmost parent ID of the comment
Source: lib/public/Comments/IComment.php#88 Returns: string Since: 9.0.0
-
public
OCP\Comments\IComment::
setTopmostParentId
($id)¶ - sets the topmost parent ID and returns itself
Source: Parameters: - $id (string)
Returns: Since: 9.0.0
-
public
OCP\Comments\IComment::
getChildrenCount
()¶ - returns the number of children
Source: lib/public/Comments/IComment.php#106 Returns: int Since: 9.0.0
-
public
OCP\Comments\IComment::
setChildrenCount
($count)¶ - sets the number of children
Source: Parameters: - $count (int)
Returns: Since: 9.0.0
-
public
OCP\Comments\IComment::
getMessage
()¶ - returns the message of the comment
Source: lib/public/Comments/IComment.php#123 Returns: string Since: 9.0.0
-
public
OCP\Comments\IComment::
setMessage
($message, $maxLength=self::MAX_MESSAGE_LENGTH)¶ - sets the message of the comment and returns itselfWhen the given message length exceeds MAX_MESSAGE_LENGTH anMessageTooLongException shall be thrown.
Source: Parameters: - $message (string)
- $maxLength (int)
Returns: Throws: Since: 9.0.0 - $maxLength added in 16.0.2
-
public
OCP\Comments\IComment::
getMentions
()¶ - returns an array containing mentions that are included in the comment
Source: Returns: array each mention provides a ‘type’ and an ‘id’, see example below
Since: 11.0.0 The return array looks like: [
- [
‘type’ => ‘user’, ‘id’ => ‘citizen4’
], [
‘type’ => ‘group’, ‘id’ => ‘media’
], …
]
-
public
OCP\Comments\IComment::
getVerb
()¶ - returns the verb of the comment
Source: lib/public/Comments/IComment.php#167 Returns: string Since: 9.0.0
-
public
OCP\Comments\IComment::
setVerb
($verb)¶ - sets the verb of the comment, e.g. ‘comment’ or ‘like’
Source: Parameters: - $verb (string)
Returns: Since: 9.0.0
-
public
OCP\Comments\IComment::
getActorType
()¶ - returns the actor type
Source: lib/public/Comments/IComment.php#184 Returns: string Since: 9.0.0
-
public
OCP\Comments\IComment::
getActorId
()¶ - returns the actor ID
Source: lib/public/Comments/IComment.php#192 Returns: string Since: 9.0.0
-
public
OCP\Comments\IComment::
setActor
($actorType, $actorId)¶ - sets (overwrites) the actor type and id
Source: Parameters: - $actorType (string) e.g. ‘users’
- $actorId (string) e.g. ‘zombie234’
Returns: Since: 9.0.0
-
public
OCP\Comments\IComment::
getCreationDateTime
()¶ - returns the creation date of the comment.If not explicitly set, it shall default to the time of initialization.
Source: lib/public/Comments/IComment.php#212 Returns: \DateTime
Since: 9.0.0
-
public
OCP\Comments\IComment::
setCreationDateTime
($dateTime)¶ - sets the creation date of the comment and returns itself
Source: Parameters: - $dateTime (
DateTime
)
Returns: Since: 9.0.0
- $dateTime (
-
public
OCP\Comments\IComment::
getLatestChildDateTime
()¶ - returns the date of the most recent child
Source: lib/public/Comments/IComment.php#229 Returns: \DateTime
Since: 9.0.0
-
public
OCP\Comments\IComment::
setLatestChildDateTime
($dateTime)¶ - sets the date of the most recent child
Source: Parameters: - $dateTime (
DateTime
)
Returns: Since: 9.0.0
- $dateTime (
-
public
OCP\Comments\IComment::
getObjectType
()¶ - returns the object type the comment is attached to
Source: lib/public/Comments/IComment.php#246 Returns: string Since: 9.0.0
-
public
OCP\Comments\IComment::
getObjectId
()¶ - returns the object id the comment is attached to
Source: lib/public/Comments/IComment.php#254 Returns: string Since: 9.0.0
-
public
OCP\Comments\IComment::
setObject
($objectType, $objectId)¶ - sets (overwrites) the object of the comment
Source: Parameters: - $objectType (string) e.g. ‘files’
- $objectId (string) e.g. ‘16435’
Returns: Since: 9.0.0
-
public
OCP\Comments\IComment::
getReferenceId
()¶ - returns the reference id of the comment
Source: lib/public/Comments/IComment.php#272 Returns: string | null Since: 19.0.0
-
public
OCP\Comments\IComment::
setReferenceId
($referenceId)¶ - sets (overwrites) the reference id of the comment
Source: Parameters: - $referenceId (string | null) e.g. sha256 hash sum
Returns: Since: 19.0.0