You are here

protected function ConditionalFieldsHandlersManager::getDiscovery in Conditional Fields 8

Same name and namespace in other branches
  1. 4.x src/ConditionalFieldsHandlersManager.php \Drupal\conditional_fields\ConditionalFieldsHandlersManager::getDiscovery()

Gets the plugin discovery.

Return value

\Drupal\Component\Plugin\Discovery\DiscoveryInterface

Overrides DefaultPluginManager::getDiscovery

2 calls to ConditionalFieldsHandlersManager::getDiscovery()
ConditionalFieldsHandlersManager::registerDefinitions in src/ConditionalFieldsHandlersManager.php
Callback for registering definitions for constraints shipped with Symfony.
ConditionalFieldsHandlersManager::__construct in src/ConditionalFieldsHandlersManager.php
Constructs a new ConditionalFieldsHandlersManager object.

File

src/ConditionalFieldsHandlersManager.php, line 43

Class

ConditionalFieldsHandlersManager
Manages discovery and instantiation of handler plugins.

Namespace

Drupal\conditional_fields

Code

protected function getDiscovery() {
  if (!isset($this->discovery)) {
    $this->discovery = parent::getDiscovery();
    $this->discovery = new StaticDiscoveryDecorator($this->discovery, [
      $this,
      'registerDefinitions',
    ]);
  }
  return $this->discovery;
}