You are here

protected function BlockVariantTrait::eventDispatcher in Chaos Tool Suite (ctools) 8.3

Gets the event dispatcher.

Return value

\Symfony\Component\EventDispatcher\EventDispatcherInterface

File

src/Plugin/BlockVariantTrait.php, line 148

Class

BlockVariantTrait
Provides methods for \Drupal\ctools\Plugin\BlockVariantInterface.

Namespace

Drupal\ctools\Plugin

Code

protected function eventDispatcher() {
  if (!$this->eventDispatcher) {
    $this->eventDispatcher = \Drupal::service('event_dispatcher');
  }
  return $this->eventDispatcher;
}