Constants

MAX_MESSAGE_LENGTH

MAX_MESSAGE_LENGTH

Methods

getId()

getId() : string

returns the ID of the comment

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).

Returns

string

setId()

setId(string  $id) : \OCP\Comments\IComment

sets the ID of the comment and returns itself

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

string $id

Throws

\OCP\Comments\IllegalIDChangeException

Returns

\OCP\Comments\IComment

getParentId()

getParentId() : string

returns the parent ID of the comment

Returns

string

setParentId()

setParentId(string  $parentId) : \OCP\Comments\IComment

sets the parent ID and returns itself

Parameters

string $parentId

Returns

\OCP\Comments\IComment

getTopmostParentId()

getTopmostParentId() : string

returns the topmost parent ID of the comment

Returns

string

setTopmostParentId()

setTopmostParentId(string  $id) : \OCP\Comments\IComment

sets the topmost parent ID and returns itself

Parameters

string $id

Returns

\OCP\Comments\IComment

getChildrenCount()

getChildrenCount() : integer

returns the number of children

Returns

integer

setChildrenCount()

setChildrenCount(integer  $count) : \OCP\Comments\IComment

sets the number of children

Parameters

integer $count

Returns

\OCP\Comments\IComment

getMessage()

getMessage() : string

returns the message of the comment

Returns

string

setMessage()

setMessage(string  $message) : \OCP\Comments\IComment

sets the message of the comment and returns itself

When the given message length exceeds MAX_MESSAGE_LENGTH an MessageTooLongException shall be thrown.

Parameters

string $message

Throws

\OCP\Comments\MessageTooLongException

Returns

\OCP\Comments\IComment

getVerb()

getVerb() : string

returns the verb of the comment

Returns

string

setVerb()

setVerb(string  $verb) : \OCP\Comments\IComment

sets the verb of the comment, e.g. 'comment' or 'like'

Parameters

string $verb

Returns

\OCP\Comments\IComment

getActorType()

getActorType() : string

returns the actor type

Returns

string

getActorId()

getActorId() : string

returns the actor ID

Returns

string

setActor()

setActor(string  $actorType, string  $actorId) : \OCP\Comments\IComment

sets (overwrites) the actor type and id

Parameters

string $actorType

e.g. 'users'

string $actorId

e.g. 'zombie234'

Returns

\OCP\Comments\IComment

getCreationDateTime()

getCreationDateTime() : \DateTime

returns the creation date of the comment.

If not explicitly set, it shall default to the time of initialization.

Returns

\DateTime

setCreationDateTime()

setCreationDateTime(\DateTime  $dateTime) : \OCP\Comments\IComment

sets the creation date of the comment and returns itself

Parameters

\DateTime $dateTime

Returns

\OCP\Comments\IComment

getLatestChildDateTime()

getLatestChildDateTime() : \DateTime

returns the date of the most recent child

Returns

\DateTime

setLatestChildDateTime()

setLatestChildDateTime(\DateTime  $dateTime) : \OCP\Comments\IComment

sets the date of the most recent child

Parameters

\DateTime $dateTime

Returns

\OCP\Comments\IComment

getObjectType()

getObjectType() : string

returns the object type the comment is attached to

Returns

string

getObjectId()

getObjectId() : string

returns the object id the comment is attached to

Returns

string

setObject()

setObject(string  $objectType, string  $objectId) : \OCP\Comments\IComment

sets (overwrites) the object of the comment

Parameters

string $objectType

e.g. 'files'

string $objectId

e.g. '16435'

Returns

\OCP\Comments\IComment