Class that holds an event dispatcher
Expanded class hierarchy of AbstractHasDispatcher
class AbstractHasDispatcher implements HasDispatcherInterface {
/**
* @var EventDispatcherInterface
*/
protected $eventDispatcher;
/**
* {@inheritdoc}
*/
public static function getAllEvents() {
return array();
}
/**
* {@inheritdoc}
*/
public function setEventDispatcher(EventDispatcherInterface $eventDispatcher) {
$this->eventDispatcher = $eventDispatcher;
return $this;
}
/**
* {@inheritdoc}
*/
public function getEventDispatcher() {
if (!$this->eventDispatcher) {
$this->eventDispatcher = new EventDispatcher();
}
return $this->eventDispatcher;
}
/**
* {@inheritdoc}
*/
public function dispatch($eventName, array $context = array()) {
$this
->getEventDispatcher()
->dispatch($eventName, new Event($context));
}
/**
* {@inheritdoc}
*/
public function addSubscriber(EventSubscriberInterface $subscriber) {
$this
->getEventDispatcher()
->addSubscriber($subscriber);
return $this;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractHasDispatcher:: |
protected | property | ||
AbstractHasDispatcher:: |
public | function |
Add an event subscriber to the dispatcher Overrides HasDispatcherInterface:: |
|
AbstractHasDispatcher:: |
public | function |
Helper to dispatch Guzzle events and set the event name on the event Overrides HasDispatcherInterface:: |
|
AbstractHasDispatcher:: |
public static | function |
Get a list of all of the events emitted from the class Overrides HasDispatcherInterface:: |
2 |
AbstractHasDispatcher:: |
public | function |
Get the EventDispatcher of the request Overrides HasDispatcherInterface:: |
|
AbstractHasDispatcher:: |
public | function |
Set the EventDispatcher of the request Overrides HasDispatcherInterface:: |