Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • ContainerAwareEventDispatcher
  • Event
  • EventDispatcher
  • GenericEvent
  • ImmutableEventDispatcher

Interfaces

  • EventDispatcherInterface
  • EventSubscriberInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Interface EventDispatcherInterface

The EventDispatcherInterface is the central point of Symfony's event listener system. Listeners are registered on the manager and events are dispatched through the manager.

Direct known implementers

Symfony\Component\EventDispatcher\EventDispatcher, Symfony\Component\EventDispatcher\ImmutableEventDispatcher

Indirect known implementers

Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher
Namespace: Symfony\Component\EventDispatcher
Author: Bernhard Schussek <bschussek@gmail.com>
Api
Located at event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php
Methods summary
public Symfony\Component\EventDispatcher\Event
# dispatch( string $eventName, Symfony\Component\EventDispatcher\Event $event = null )

Dispatches an event to all registered listeners.

Dispatches an event to all registered listeners.

Parameters

$eventName
string
$eventName The name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners.
$event
Symfony\Component\EventDispatcher\Event
$event The event to pass to the event handlers/listeners. If not supplied, an empty Event instance is created.

Returns

Symfony\Component\EventDispatcher\Event

Api

public
# addListener( string $eventName, callable $listener, integer $priority = 0 )

Adds an event listener that listens on the specified events.

Adds an event listener that listens on the specified events.

Parameters

$eventName
string
$eventName The event to listen on
$listener
callable
$listener The listener
$priority
integer
$priority The higher this value, the earlier an event listener will be triggered in the chain (defaults to 0)

Api

public
# addSubscriber( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )

Adds an event subscriber.

Adds an event subscriber.

The subscriber is asked for all the events he is interested in and added as a listener for these events.

Parameters

$subscriber
Symfony\Component\EventDispatcher\EventSubscriberInterface
$subscriber The subscriber.

Api

public
# removeListener( string|array $eventName, callable $listener )

Removes an event listener from the specified events.

Removes an event listener from the specified events.

Parameters

$eventName
string|array
$eventName The event(s) to remove a listener from
$listener
callable
$listener The listener to remove
public
# removeSubscriber( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )

Removes an event subscriber.

Removes an event subscriber.

Parameters

$subscriber
Symfony\Component\EventDispatcher\EventSubscriberInterface
$subscriber The subscriber
public array
# getListeners( string $eventName = null )

Gets the listeners of a specific event or all listeners.

Gets the listeners of a specific event or all listeners.

Parameters

$eventName
string
$eventName The name of the event

Returns

array
The event listeners for the specified event, or all event listeners by event name
public Boolean
# hasListeners( string $eventName = null )

Checks whether an event has any registered listeners.

Checks whether an event has any registered listeners.

Parameters

$eventName
string
$eventName The name of the event

Returns

Boolean
true if the specified event has any listeners, false otherwise
php-coveralls API documentation generated by ApiGen 2.8.0