Nextcloud PHP API (stable19)

IEventDispatcher

Event dispatcher service of Nextcloud

Tags
since
17.0.0

Table of Contents

addListener()  : void
addServiceListener()  : void
dispatch()  : void
dispatchTyped()  : void
Dispatch a typed event
removeListener()  : void

Methods

addListener()

public addListener(string $eventName, callable $listener, int $priority) : void
Parameters
$eventName : string

preferably the fully-qualified class name of the Event sub class

$listener : callable

the object that is invoked when a matching event is dispatched

$priority : int
Tags
since
17.0.0

addServiceListener()

public addServiceListener(string $eventName, string $className, int $priority) : void
Parameters
$eventName : string

preferably the fully-qualified class name of the Event sub class to listen for

$className : string

fully qualified class name (or ::class notation) of a \OCP\EventDispatcher\IEventListener that can be built by the DI container

$priority : int
Tags
since
17.0.0

dispatch()

public dispatch(string $eventName, Event $event) : void
Parameters
$eventName : string
$event : Event
Tags
since
17.0.0

dispatchTyped()

Dispatch a typed event

public dispatchTyped(Event $event) : void

Only use this with subclasses of \OCP\EventDispatcher\Event. The object's class will determine the event name.

Parameters
$event : Event
Tags
since
18.0.0

removeListener()

public removeListener(string $eventName, callable $listener) : void
Parameters
$eventName : string

preferably the fully-qualified class name of the Event sub class

$listener : callable

the object that is invoked when a matching event is dispatched

Tags
since
19.0.0

Search results