function HookDiscovery::getDefinitions
Overrides DiscoveryTrait::getDefinitions
File
-
core/
lib/ Drupal/ Core/ Plugin/ Discovery/ HookDiscovery.php, line 47
Class
- HookDiscovery
- Provides a hook-based plugin discovery class.
Namespace
Drupal\Core\Plugin\DiscoveryCode
public function getDefinitions() {
$definitions = [];
foreach ($this->moduleHandler
->getImplementations($this->hook) as $module) {
$result = $this->moduleHandler
->invoke($module, $this->hook);
foreach ($result as $plugin_id => $definition) {
$definition['provider'] = $module;
$definitions[$plugin_id] = $definition;
}
}
return $definitions;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.