3 namespace Drupal\Component\Plugin\Discovery;
6 * An interface defining the minimum requirements of building a plugin
11 interface DiscoveryInterface {
14 * Gets a specific plugin definition.
16 * @param string $plugin_id
18 * @param bool $exception_on_invalid
19 * (optional) If TRUE, an invalid plugin ID will throw an exception.
22 * A plugin definition, or NULL if the plugin ID is invalid and
23 * $exception_on_invalid is FALSE.
25 * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
26 * Thrown if $plugin_id is invalid and $exception_on_invalid is TRUE.
28 public function getDefinition($plugin_id, $exception_on_invalid = TRUE);
31 * Gets the definition of all plugins for this type.
34 * An array of plugin definitions (empty array if no definitions were
35 * found). Keys are plugin IDs.
37 public function getDefinitions();
40 * Indicates if a specific plugin definition exists.
42 * @param string $plugin_id
46 * TRUE if the definition exists, FALSE otherwise.
48 public function hasDefinition($plugin_id);