Upgraded drupal core with security updates
[yaffs-website] / web / core / lib / Drupal / Component / Plugin / CategorizingPluginManagerInterface.php
1 <?php
2
3 namespace Drupal\Component\Plugin;
4
5 /**
6  * Defines an interface for plugin managers that categorize plugin definitions.
7  */
8 interface CategorizingPluginManagerInterface extends PluginManagerInterface {
9
10   /**
11    * Gets the names of all categories.
12    *
13    * @return string[]
14    *   An array of translated categories, sorted alphabetically.
15    */
16   public function getCategories();
17
18   /**
19    * Gets sorted plugin definitions.
20    *
21    * @param array[]|null $definitions
22    *   (optional) The plugin definitions to sort. If omitted, all plugin
23    *   definitions are used.
24    *
25    * @return array[]
26    *   An array of plugin definitions, sorted by category and label.
27    */
28   public function getSortedDefinitions(array $definitions = NULL);
29
30   /**
31    * Gets sorted plugin definitions grouped by category.
32    *
33    * In addition to grouping, both categories and its entries are sorted,
34    * whereas plugin definitions are sorted by label.
35    *
36    * @param array[]|null $definitions
37    *   (optional) The plugin definitions to group. If omitted, all plugin
38    *   definitions are used.
39    *
40    * @return array[]
41    *   Keys are category names, and values are arrays of which the keys are
42    *   plugin IDs and the values are plugin definitions.
43    */
44   public function getGroupedDefinitions(array $definitions = NULL);
45
46 }