function StaticDiscoveryDecorator::getDefinition

Same name in other branches
  1. 9 core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php \Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator::getDefinition()
  2. 8.9.x core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php \Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator::getDefinition()
  3. 10 core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php \Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator::getDefinition()

Overrides DiscoveryCachedTrait::getDefinition

File

core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php, line 41

Class

StaticDiscoveryDecorator
A decorator that allows manual registration of undiscoverable definitions.

Namespace

Drupal\Component\Plugin\Discovery

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.