You are here

public function InfoHookDecorator::getDefinitions in Plug 7

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

Overrides DiscoveryTrait::getDefinitions

File

lib/Drupal/Core/Plugin/Discovery/InfoHookDecorator.php, line 50
Contains \Drupal\Core\Plugin\Discovery\InfoHookDecorator.

Class

InfoHookDecorator
Allows info hook implementations to enhance discovered plugin definitions.

Namespace

Drupal\Core\Plugin\Discovery

Code

public function getDefinitions() {
  $definitions = $this->decorated
    ->getDefinitions();
  foreach (\Drupal::moduleHandler()
    ->getImplementations($this->hook) as $module) {
    $function = $module . '_' . $this->hook;
    $function($definitions);
  }
  return $definitions;
}