Gets the event dispatcher.
\Symfony\Contracts\EventDispatcher\EventDispatcherInterface
protected function getEventDispatcher() { if (!$this->eventDispatcher) { $this->eventDispatcher = \Drupal::service('event_dispatcher'); } return $this->eventDispatcher; }