IEventDispatcher
Event dispatcher service of Nextcloud
Tags
Table of Contents
- addListener() : void
- addServiceListener() : void
- dispatch() : void
- dispatchTyped() : void
- Dispatch a typed event
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
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
dispatch()
public
dispatch(string $eventName, Event $event) : void
Parameters
- $eventName : string
- $event : Event
Tags
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