3 namespace Drupal\Component\Plugin;
6 * Defines an interface for plugin managers that categorize plugin definitions.
8 interface CategorizingPluginManagerInterface extends PluginManagerInterface {
11 * Gets the names of all categories.
14 * An array of translated categories, sorted alphabetically.
16 public function getCategories();
19 * Gets sorted plugin definitions.
21 * @param array[]|null $definitions
22 * (optional) The plugin definitions to sort. If omitted, all plugin
23 * definitions are used.
26 * An array of plugin definitions, sorted by category and label.
28 public function getSortedDefinitions(array $definitions = NULL);
31 * Gets sorted plugin definitions grouped by category.
33 * In addition to grouping, both categories and its entries are sorted,
34 * whereas plugin definitions are sorted by label.
36 * @param array[]|null $definitions
37 * (optional) The plugin definitions to group. If omitted, all plugin
38 * definitions are used.
41 * Keys are category names, and values are arrays of which the keys are
42 * plugin IDs and the values are plugin definitions.
44 public function getGroupedDefinitions(array $definitions = NULL);