Nextcloud PHP API (stable19)

CommentsEntityEvent extends Event

Class CommentsEntityEvent

Typically this class isn't instantiated directly but sub classed for specific event types

Tags
since
9.1.0

Table of Contents

EVENT_ENTITY  = 'OCP\Comments\ICommentsManager::registerEntity'
$collections  : \Closure[]
$event  : string
__construct()  : mixed
DispatcherEvent constructor.
addEntityCollection()  : mixed
getEntityCollections()  : \Closure[]

Constants

EVENT_ENTITY

public mixed EVENT_ENTITY = 'OCP\Comments\ICommentsManager::registerEntity'

Properties

Methods

__construct()

DispatcherEvent constructor.

public __construct(string $event) : mixed

In Nextcloud 17.0.0 this event class used a now deprecated/removed Symfony base class that had a constructor (with default arguments). To lower the risk of a breaking change (PHP won't allow parent constructor calls if there is none), this empty constructor's only purpose is to hopefully not break existing sub- classes of this class.

Parameters
$event : string
Tags
since
9.1.0
Return values
mixed

addEntityCollection()

public addEntityCollection(string $name, Closure $entityExistsFunction) : mixed
Parameters
$name : string
$entityExistsFunction : Closure

The closure should take one argument, which is the id of the entity, that comments should be handled for. The return should then be bool, depending on whether comments are allowed (true) or not.

Tags
throws
OutOfBoundsException

when the entity name is already taken

since
9.1.0
Return values
mixed

getEntityCollections()

public getEntityCollections() : \Closure[]
Tags
since
9.1.0
Return values
\Closure[]

Search results