You are here

interface CategorizingPluginManagerInterface in Plug 7

Defines an interface for plugin managers that categorize plugin definitions.

Hierarchy

Expanded class hierarchy of CategorizingPluginManagerInterface

All classes that implement CategorizingPluginManagerInterface

File

lib/Drupal/Component/Plugin/CategorizingPluginManagerInterface.php, line 13
Contains \Drupal\Component\Plugin\CategorizingPluginManagerInterface.

Namespace

Drupal\Component\Plugin
View source
interface CategorizingPluginManagerInterface extends PluginManagerInterface {

  /**
   * Gets the names of all categories.
   *
   * @return string[]
   *   An array of translated categories, sorted alphabetically.
   */
  public function getCategories();

  /**
   * Gets sorted plugin definitions.
   *
   * @param array[]|null $definitions
   *   (optional) The plugin definitions to sort. If omitted, all plugin
   *   definitions are used.
   *
   * @return array[]
   *   An array of plugin definitions, sorted by category and label.
   */
  public function getSortedDefinitions(array $definitions = NULL);

  /**
   * Gets sorted plugin definitions grouped by category.
   *
   * In addition to grouping, both categories and its entries are sorted,
   * whereas plugin definitions are sorted by label.
   *
   * @param array[]|null $definitions
   *   (optional) The plugin definitions to group. If omitted, all plugin
   *   definitions are used.
   *
   * @return array[]
   *   Keys are category names, and values are arrays of which the keys are
   *   plugin IDs and the values are plugin definitions.
   */
  public function getGroupedDefinitions(array $definitions = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
CategorizingPluginManagerInterface::getCategories public function Gets the names of all categories.
CategorizingPluginManagerInterface::getGroupedDefinitions public function Gets sorted plugin definitions grouped by category.
CategorizingPluginManagerInterface::getSortedDefinitions public function Gets sorted plugin definitions.
DiscoveryInterface::getDefinition public function Gets a specific plugin definition.
DiscoveryInterface::getDefinitions public function Gets the definition of all plugins for this type.
DiscoveryInterface::hasDefinition public function Indicates if a specific plugin definition exists.
FactoryInterface::createInstance public function Creates a pre-configured instance of a plugin. 2
MapperInterface::getInstance public function Gets a preconfigured instance of a plugin. 1