public function StaticDiscoveryDecorator::getDefinition

Implements Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinition().

Overrides StaticDiscovery::getDefinition

File

drupal/core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php, line 46
Contains \Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator.

Class

StaticDiscoveryDecorator
A decorator that allows manual registration of undiscoverable definitions.

Namespace

Drupal\Component\Plugin\Discovery

Code

public function getDefinition($base_plugin_id) {
  if (isset($this->registerDefinitions)) {
    call_user_func($this->registerDefinitions);
  }
  $this->definitions += $this->decorated
    ->getDefinitions();
  return parent::getDefinition($base_plugin_id);
}