interface DiscoveryInterface (View source)

An interface defining the minimum requirements of building a plugin discovery component.

Methods

mixed
getDefinition(string $plugin_id, bool $exception_on_invalid = TRUE)

Gets a specific plugin definition.

array
getDefinitions()

Gets the definition of all plugins for this type.

bool
hasDefinition(string $plugin_id)

Indicates if a specific plugin definition exists.

Details

mixed getDefinition(string $plugin_id, bool $exception_on_invalid = TRUE)

Gets a specific plugin definition.

Parameters

string $plugin_id

A plugin id.

bool $exception_on_invalid

(optional) If TRUE, an invalid plugin ID will throw an exception.

Return Value

mixed

A plugin definition, or NULL if the plugin ID is invalid and $exception_on_invalid is FALSE.

Exceptions

PluginNotFoundException

array getDefinitions()

Gets the definition of all plugins for this type.

Return Value

array

An array of plugin definitions (empty array if no definitions were found). Keys are plugin IDs.

See also

FilteredPluginManagerInterface::getFilteredDefinitions

bool hasDefinition(string $plugin_id)

Indicates if a specific plugin definition exists.

Parameters

string $plugin_id

A plugin ID.

Return Value

bool

TRUE if the definition exists, FALSE otherwise.