SymfonyAdapter

class OC\EventDispatcher\SymfonyAdapter
Source:lib/private/EventDispatcher/SymfonyAdapter.php#44
Implements:Symfony\Component\EventDispatcher\EventDispatcherInterface

Properties

Methods

public OC\EventDispatcher\SymfonyAdapter::__construct($eventDispatcher, $logger)
Source:lib/private/EventDispatcher/SymfonyAdapter.php#54
Deprecated:20.0.0
public OC\EventDispatcher\SymfonyAdapter::dispatch($eventName, $event=null)
Dispatches an event to all registered listeners.
Source:

lib/private/EventDispatcher/SymfonyAdapter.php#93

Parameters:
  • $eventName (string) The name of the event to dispatch. The name of

the event is the name of the method that is invoked on listeners. * $event (OCP\EventDispatcher\Event | null) The event to pass to the event handlers/listeners If not supplied, an empty Event instance is created

Returns:

object the emitted event

Deprecated:

20.0.0

public OC\EventDispatcher\SymfonyAdapter::addListener($eventName, $listener, $priority=0)
Adds an event listener that listens on the specified events.
Source:

lib/private/EventDispatcher/SymfonyAdapter.php#137

Parameters:
  • $eventName (string) The event to listen on
  • $listener (callable) The listener
  • $priority (int) The higher this value, the earlier an event

listener will be triggered in the chain (defaults to 0)

Deprecated:

20.0.0

public OC\EventDispatcher\SymfonyAdapter::addSubscriber($subscriber)
Adds an event subscriber.
The subscriber is asked for all the events it is
interested in and added as a listener for these events.
Source:lib/private/EventDispatcher/SymfonyAdapter.php#153
Deprecated:20.0.0
public OC\EventDispatcher\SymfonyAdapter::removeListener($eventName, $listener)
Removes an event listener from the specified events.
Source:

lib/private/EventDispatcher/SymfonyAdapter.php#164

Parameters:
  • $eventName (string) The event to remove a listener from
  • $listener (callable) The listener to remove
Deprecated:

20.0.0

public OC\EventDispatcher\SymfonyAdapter::removeSubscriber($subscriber)
Source:lib/private/EventDispatcher/SymfonyAdapter.php#171
Deprecated:20.0.0
public OC\EventDispatcher\SymfonyAdapter::getListeners($eventName=null)
Gets the listeners of a specific event or all listeners sorted by descending priority.
Source:

lib/private/EventDispatcher/SymfonyAdapter.php#183

Parameters:
  • $eventName (string | null) The name of the event
Returns:

array The event listeners for the specified event, or all event listeners by event name

Deprecated:

20.0.0

public OC\EventDispatcher\SymfonyAdapter::getListenerPriority($eventName, $listener)
Gets the listener priority for a specific event.
Returns null if the event or the listener does not exist.
Source:

lib/private/EventDispatcher/SymfonyAdapter.php#198

Parameters:
  • $eventName (string) The name of the event
  • $listener (callable) The listener
Returns:

int | null The event listener priority

Deprecated:

20.0.0

public OC\EventDispatcher\SymfonyAdapter::hasListeners($eventName=null)
Checks whether an event has any registered listeners.
Source:

lib/private/EventDispatcher/SymfonyAdapter.php#210

Parameters:
  • $eventName (string | null) The name of the event
Returns:

bool true if the specified event has any listeners, false otherwise

Deprecated:

20.0.0