-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCategorizingPluginManagerInterface.php
More file actions
60 lines (54 loc) · 1.97 KB
/
CategorizingPluginManagerInterface.php
File metadata and controls
60 lines (54 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace Drupal\Component\Plugin;
/**
* Defines an interface for plugin managers that categorize plugin definitions.
*/
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.
* phpcs:ignore Drupal.Commenting.FunctionComment.ParamNameNoMatch
* @param string $label_key
* (optional) The key to be used as a label for sorting.
*
* @return array[]
* An array of plugin definitions, sorted by category and label.
*
* @see https://www.drupal.org/project/drupal/issues/3354672
*
* @todo Uncomment the new $label_key method parameter before drupal:12.0.0.
*/
public function getSortedDefinitions(?array $definitions = NULL /*, string $label_key = 'label' */);
/**
* 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.
* phpcs:ignore Drupal.Commenting.FunctionComment.ParamNameNoMatch
* @param string $label_key
* (optional) The key to be used as a label for sorting.
*
* @return array[]
* Keys are category names, and values are arrays of which the keys are
* plugin IDs and the values are plugin definitions.
*
* @see https://www.drupal.org/project/drupal/issues/3354672
*
* @todo Uncomment the new $label_key method parameter before drupal:12.0.0.
*/
public function getGroupedDefinitions(?array $definitions = NULL /*, string $label_key = 'label' */);
}