ContainerAwareEventDispatcher::removeListener()

removeListener(string $eventName, callable $listener) Removes an event listener from the specified events. Parameters string $eventName The event to remove a listener from callable $listener The listener to remove

ContainerAwareEventDispatcher::hasListeners()

bool hasListeners(string $eventName = null) Checks whether an event has any registered listeners. Parameters string $eventName The name of the event Return Value bool true if the specified event has any listeners, false otherwise

ContainerAwareEventDispatcher::getListeners()

array getListeners(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. Parameters string $eventName The name of the event Return Value array The event listeners for the specified event, or all event listeners by event name

ContainerAwareEventDispatcher::getListenerPriority()

int|null getListenerPriority(string $eventName, callable $listener) Gets the listener priority for a specific event. Returns null if the event or the listener does not exist. Parameters string $eventName The name of the event callable $listener The listener Return Value int|null The event listener priority

ContainerAwareEventDispatcher::getContainer()

getContainer()

ContainerAwareEventDispatcher::addSubscriberService()

addSubscriberService(string $serviceId, string $class) Adds a service as event subscriber. Parameters string $serviceId The service ID of the subscriber service string $class The service's class name (which must implement EventSubscriberInterface)

ContainerAwareEventDispatcher::addListenerService()

addListenerService(string $eventName, array $callback, int $priority) Adds a service as event listener. Parameters string $eventName Event for which the listener is added array $callback The service ID of the listener service & the method name that has to be called int $priority The higher this value, the earlier an event listener will be triggered in the chain. Defaults to 0. Exceptions InvalidArgumentException

ContainerAwareEventDispatcher

class ContainerAwareEventDispatcher extends EventDispatcher Lazily loads listeners and subscribers from the dependency injection container. Methods Event dispatch(string $eventName, Event $event = null) Dispatches an event to all registered listeners. from EventDispatcher array getListeners(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. int|null getListenerPriority(string $eventName, callable $listener) Gets the l

ContainerAwareCommand

class ContainerAwareCommand extends Command implements ContainerAwareInterface Command. Methods __construct(string|null $name = null) Constructor. from Command ignoreValidationErrors() Ignores validation errors. from Command setApplication(Application $application = null) Sets the application instance for this command. from Command setHelperSet(HelperSet $helperSet) Sets the helper set. from Command HelperSet getHelperSet() Gets the helper set. from Command Application

ContainerAware deprecated

class ContainerAware implements ContainerAwareInterface deprecated since version 2.8, to be removed in 3.0. Use the ContainerAwareTrait instead. A simple implementation of ContainerAwareInterface. Methods setContainer(ContainerInterface $container = null) Sets the container. Details setContainer(ContainerInterface $container = null) Sets the container. Parameters ContainerInterface $container A ContainerInterface instance or null