Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DiscoveryInterface.php

interface DiscoveryInterface

Same name in this branch
  1. 11.1.x vendor/open-telemetry/sdk/Common/Http/Psr/Client/Discovery/DiscoveryInterface.php \OpenTelemetry\SDK\Common\Http\Psr\Client\Discovery\DiscoveryInterface

Defines the minimum requirements for a plugin discovery component.

Hierarchy

  • interface \Drupal\Component\Plugin\Discovery\DiscoveryInterface

Expanded class hierarchy of DiscoveryInterface

All classes that implement DiscoveryInterface

Related topics

Plugin API
Using the Plugin API
16 files declare their use of DiscoveryInterface
AnnotatedClassDiscovery.php in core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php
AnnotationBridgeDecorator.php in core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecorator.php
CKEditor5PluginManagerInterface.php in core/modules/ckeditor5/src/Plugin/CKEditor5PluginManagerInterface.php
ConfigSchemaDiscovery.php in core/lib/Drupal/Core/Config/Schema/ConfigSchemaDiscovery.php
DefaultFactory.php in core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php

... See full list

File

core/lib/Drupal/Component/Plugin/Discovery/DiscoveryInterface.php, line 10

Namespace

Drupal\Component\Plugin\Discovery
View source
interface DiscoveryInterface {
    
    /**
     * Gets a specific plugin definition.
     *
     * @param string $plugin_id
     *   A plugin id.
     * @param bool $exception_on_invalid
     *   (optional) If TRUE, an invalid plugin ID will throw an exception.
     *
     * @return mixed
     *   A plugin definition, or NULL if the plugin ID is invalid and
     *   $exception_on_invalid is FALSE.
     *
     * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
     *   Thrown if $plugin_id is invalid and $exception_on_invalid is TRUE.
     */
    public function getDefinition($plugin_id, $exception_on_invalid = TRUE);
    
    /**
     * Gets the definition of all plugins for this type.
     *
     * @return mixed[]
     *   An array of plugin definitions (empty array if no definitions were
     *   found). Keys are plugin IDs.
     *
     * @see \Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions()
     */
    public function getDefinitions();
    
    /**
     * Indicates if a specific plugin definition exists.
     *
     * @param string $plugin_id
     *   A plugin ID.
     *
     * @return bool
     *   TRUE if the definition exists, FALSE otherwise.
     */
    public function hasDefinition($plugin_id);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
DiscoveryInterface::getDefinition public function Gets a specific plugin definition. 2
DiscoveryInterface::getDefinitions public function Gets the definition of all plugins for this type. 1
DiscoveryInterface::hasDefinition public function Indicates if a specific plugin definition exists.
RSS feed
Powered by Drupal