class EventDispatcher in Currency 8.3
Provides a Currency event dispatcher.
Hierarchy
- class \Drupal\currency\EventDispatcher implements EventDispatcherInterface
Expanded class hierarchy of EventDispatcher
1 file declares its use of EventDispatcher
- EventDispatcherTest.php in tests/
src/ Unit/ EventDispatcherTest.php
1 string reference to 'EventDispatcher'
1 service uses EventDispatcher
File
- src/
EventDispatcher.php, line 12
Namespace
Drupal\currencyView source
class EventDispatcher implements EventDispatcherInterface {
/**
* The Symfony event dispatcher.
*
* @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
*/
protected $symfonyEventDispatcher;
/**
* Constructs a new instance.
*
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $symfony_event_dispatcher
*/
public function __construct(SymfonyEventDispatcherInterface $symfony_event_dispatcher) {
$this->symfonyEventDispatcher = $symfony_event_dispatcher;
}
/**
* {@inheritdoc}
*/
public function resolveCountryCode() {
$event = new ResolveCountryCode();
$this->symfonyEventDispatcher
->dispatch(CurrencyEvents::RESOLVE_COUNTRY_CODE, $event);
return $event
->getCountryCode();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EventDispatcher:: |
protected | property | The Symfony event dispatcher. | |
EventDispatcher:: |
public | function |
Gets the current country code. Overrides EventDispatcherInterface:: |
|
EventDispatcher:: |
public | function | Constructs a new instance. |