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

Class EventDispatcher

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.

Symfony\Component\EventDispatcher\EventDispatcher implements Symfony\Component\EventDispatcher\EventDispatcherInterface

Direct known subclasses

Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher
Namespace: Symfony\Component\EventDispatcher
Author: Guilherme Blanco <guilhermeblanco@hotmail.com>
Author: Jonathan Wage <jonwage@gmail.com>
Author: Roman Borschel <roman@code-factory.org>
Author: Bernhard Schussek <bschussek@gmail.com>
Author: Fabien Potencier <fabien@symfony.com>
Author: Jordi Boggiano <j.boggiano@seld.be>
Author: Jordan Alliot <jordan.alliot@gmail.com>
Api
Located at event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php
Methods summary
public Symfony\Component\EventDispatcher\Event
# dispatch( string $eventName, Symfony\Component\EventDispatcher\Event $event = null )

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

See

Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()

Api

Implementation of

Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()
public array
# getListeners( string $eventName = null )

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

See

Symfony\Component\EventDispatcher\EventDispatcherInterface::getListeners()

Implementation of

Symfony\Component\EventDispatcher\EventDispatcherInterface::getListeners()
public Boolean
# hasListeners( string $eventName = null )

Parameters

$eventName
string
$eventName The name of the event

Returns

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

See

Symfony\Component\EventDispatcher\EventDispatcherInterface::hasListeners()

Implementation of

Symfony\Component\EventDispatcher\EventDispatcherInterface::hasListeners()
public
# addListener( string $eventName, callable $listener, integer $priority = 0 )

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)

See

Symfony\Component\EventDispatcher\EventDispatcherInterface::addListener()

Api

Implementation of

Symfony\Component\EventDispatcher\EventDispatcherInterface::addListener()
public
# removeListener( string|array $eventName, callable $listener )

Parameters

$eventName
string|array
$eventName The event(s) to remove a listener from
$listener
callable
$listener The listener to remove

See

Symfony\Component\EventDispatcher\EventDispatcherInterface::removeListener()

Implementation of

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

Parameters

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

See

Symfony\Component\EventDispatcher\EventDispatcherInterface::addSubscriber()

Api

Implementation of

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

Parameters

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

See

Symfony\Component\EventDispatcher\EventDispatcherInterface::removeSubscriber()

Implementation of

Symfony\Component\EventDispatcher\EventDispatcherInterface::removeSubscriber()
protected
# doDispatch( array[callback] $listeners, string $eventName, Symfony\Component\EventDispatcher\Event $event )

Triggers the listeners of an event.

Triggers the listeners of an event.

This method can be overridden to add functionality that is executed for each listener.

Parameters

$listeners
array[callback]
$listeners The event listeners.
$eventName
string
$eventName The name of the event to dispatch.
$event
Symfony\Component\EventDispatcher\Event
$event The event object to pass to the event handlers/listeners.
php-coveralls API documentation generated by ApiGen 2.8.0