IEventDispatcher¶
-
interface
OCP\EventDispatcher\
IEventDispatcher
¶ - Event dispatcher service of Nextcloud
Implemented by: OC\EventDispatcher\EventDispatcher
Source: lib/public/EventDispatcher/IEventDispatcher.php#35
Methods¶
-
public
OCP\EventDispatcher\IEventDispatcher::
addListener
($eventName, $listener, $priority=0)¶ Source: 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) The higher this value, the earlier an event
listener will be triggered in the chain (defaults to 0)
Since: 17.0.0
-
public
OCP\EventDispatcher\IEventDispatcher::
removeListener
($eventName, $listener)¶ Source: 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
Since: 19.0.0
-
public
OCP\EventDispatcher\IEventDispatcher::
addServiceListener
($eventName, $className, $priority=0)¶ Source: 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 OCPEventDispatcherIEventListener that can be built by the DI container
- $priority (int) The higher this value, the earlier an event
listener will be triggered in the chain (defaults to 0)
Since: 17.0.0
-
public
OCP\EventDispatcher\IEventDispatcher::
dispatch
($eventName, $event)¶ Source: Parameters: - $eventName (string)
- $event (
OCP\EventDispatcher\Event
)
Since: 17.0.0
Deprecated: 21.0.0 use \OCP\EventDispatcher\IEventDispatcher::dispatchTyped
-
public
OCP\EventDispatcher\IEventDispatcher::
dispatchTyped
($event)¶ - Dispatch a typed eventOnly use this with subclasses of ``\OCP\EventDispatcher\Event``.The object’s class will determine the event name.
Source: Parameters: - $event (
OCP\EventDispatcher\Event
)
Since: 18.0.0
- $event (