You are here

interface DiscoveryInterface in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/Component/Plugin/Discovery/DiscoveryInterface.php \Drupal\Component\Plugin\Discovery\DiscoveryInterface

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

Hierarchy

Expanded class hierarchy of DiscoveryInterface

All classes that implement DiscoveryInterface

7 files declare their use of DiscoveryInterface
AnnotatedClassDiscovery.php in lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php
Contains \Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery.
AnnotatedClassDiscovery.php in modules/providers/service_container_annotation_discovery/src/Plugin/Discovery/AnnotatedClassDiscovery.php
Contains \Drupal\service_container_annotation_discovery\Plugin\Discovery\AnnotatedClassDiscovery
ContainerInterface.php in src/DependencyInjection/ContainerInterface.php
Contains \Drupal\service_container\DependencyInjection\ContainerInterface.
CToolsPluginDiscovery.php in src/Plugin/Discovery/CToolsPluginDiscovery.php
Contains \Drupal\service_container\Plugin\Discovery\CToolsPluginDiscovery
DefaultFactory.php in lib/Drupal/Component/Plugin/Factory/DefaultFactory.php
Contains \Drupal\Component\Plugin\Factory\DefaultFactory.

... See full list

File

lib/Drupal/Component/Plugin/Discovery/DiscoveryInterface.php, line 16
Contains \Drupal\Component\Plugin\Discovery\DiscoveryInterface.

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.
   */
  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

Namesort descending Modifiers Type Description Overrides
DiscoveryInterface::getDefinition public function Gets a specific plugin definition. 5
DiscoveryInterface::getDefinitions public function Gets the definition of all plugins for this type. 5
DiscoveryInterface::hasDefinition public function Indicates if a specific plugin definition exists. 5