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 ContainerAwareEventDispatcher

Lazily loads listeners and subscribers from the dependency injection container

Symfony\Component\EventDispatcher\EventDispatcher implements Symfony\Component\EventDispatcher\EventDispatcherInterface
Extended by Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher
Namespace: Symfony\Component\EventDispatcher
Author: Fabien Potencier <fabien@symfony.com>
Author: Bernhard Schussek <bschussek@gmail.com>
Author: Jordan Alliot <jordan.alliot@gmail.com>
Located at event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
Methods summary
public
# __construct( Symfony\Component\DependencyInjection\ContainerInterface $container )

Constructor.

Constructor.

Parameters

$container
Symfony\Component\DependencyInjection\ContainerInterface
$container A ContainerInterface instance
public
# addListenerService( string $eventName, array $callback, integer $priority = 0 )

Adds a service as event listener

Adds a service as event listener

Parameters

$eventName
string
$eventName Event for which the listener is added
$callback
array
$callback The service ID of the listener service & the method name that has to be called
$priority
integer
$priority The higher this value, the earlier an event listener will be triggered in the chain. Defaults to 0.

Throws

InvalidArgumentException
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()

Overrides

Symfony\Component\EventDispatcher\EventDispatcher::removeListener()
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()

Overrides

Symfony\Component\EventDispatcher\EventDispatcher::hasListeners()
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()

Overrides

Symfony\Component\EventDispatcher\EventDispatcher::getListeners()
public
# addSubscriberService( string $serviceId, string $class )

Adds a service as event subscriber

Adds a service as event subscriber

Parameters

$serviceId
string
$serviceId The service ID of the subscriber service
$class
string
$class The service's class name (which must implement EventSubscriberInterface)
public Symfony\Component\EventDispatcher\Event
# dispatch( string $eventName, Symfony\Component\EventDispatcher\Event $event = null )

Lazily loads listeners for this event from the dependency injection container.

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

Throws

InvalidArgumentException
if the service is not defined

Overrides

Symfony\Component\EventDispatcher\EventDispatcher::dispatch()
public
# getContainer( )
protected
# lazyLoad( string $eventName )

Lazily loads listeners for this event from the dependency injection container.

Lazily loads listeners for this event from the dependency injection container.

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.
Methods inherited from Symfony\Component\EventDispatcher\EventDispatcher
addListener(), addSubscriber(), doDispatch(), removeSubscriber()
php-coveralls API documentation generated by ApiGen 2.8.0