HookDiscovery
class HookDiscovery implements DiscoveryInterface (View source)
Provides a hook-based plugin discovery class.
Traits
Properties
| protected string | $hook | The name of the hook that will be implemented by this discovery instance. |
|
| protected ModuleHandlerInterface | $moduleHandler | The module handler used to find and execute the plugin hook. |
Methods
array
getDefinitions()
Gets the definition of all plugins for this type.
array|null
doGetDefinition(array $definitions, string $plugin_id, bool $exception_on_invalid)
Gets a specific plugin definition.
from
DiscoveryTrait
__construct(ModuleHandlerInterface $module_handler, string $hook)
Constructs a Drupal\Core\Plugin\Discovery\HookDiscovery object.
Details
array
getDefinitions()
Gets the definition of all plugins for this type.
getDefinition($plugin_id, $exception_on_invalid = TRUE)
{@inheritdoc}
protected array|null
doGetDefinition(array $definitions, string $plugin_id, bool $exception_on_invalid)
Gets a specific plugin definition.
hasDefinition($plugin_id)
{@inheritdoc}
__construct(ModuleHandlerInterface $module_handler, string $hook)
Constructs a Drupal\Core\Plugin\Discovery\HookDiscovery object.