Mercurial > hg > isophonics-drupal-site
annotate core/lib/Drupal/Component/Plugin/CategorizingPluginManagerInterface.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\Component\Plugin; |
Chris@0 | 4 |
Chris@0 | 5 /** |
Chris@0 | 6 * Defines an interface for plugin managers that categorize plugin definitions. |
Chris@0 | 7 */ |
Chris@0 | 8 interface CategorizingPluginManagerInterface extends PluginManagerInterface { |
Chris@0 | 9 |
Chris@0 | 10 /** |
Chris@0 | 11 * Gets the names of all categories. |
Chris@0 | 12 * |
Chris@0 | 13 * @return string[] |
Chris@0 | 14 * An array of translated categories, sorted alphabetically. |
Chris@0 | 15 */ |
Chris@0 | 16 public function getCategories(); |
Chris@0 | 17 |
Chris@0 | 18 /** |
Chris@0 | 19 * Gets sorted plugin definitions. |
Chris@0 | 20 * |
Chris@0 | 21 * @param array[]|null $definitions |
Chris@0 | 22 * (optional) The plugin definitions to sort. If omitted, all plugin |
Chris@0 | 23 * definitions are used. |
Chris@0 | 24 * |
Chris@0 | 25 * @return array[] |
Chris@0 | 26 * An array of plugin definitions, sorted by category and label. |
Chris@0 | 27 */ |
Chris@0 | 28 public function getSortedDefinitions(array $definitions = NULL); |
Chris@0 | 29 |
Chris@0 | 30 /** |
Chris@0 | 31 * Gets sorted plugin definitions grouped by category. |
Chris@0 | 32 * |
Chris@0 | 33 * In addition to grouping, both categories and its entries are sorted, |
Chris@0 | 34 * whereas plugin definitions are sorted by label. |
Chris@0 | 35 * |
Chris@0 | 36 * @param array[]|null $definitions |
Chris@0 | 37 * (optional) The plugin definitions to group. If omitted, all plugin |
Chris@0 | 38 * definitions are used. |
Chris@0 | 39 * |
Chris@0 | 40 * @return array[] |
Chris@0 | 41 * Keys are category names, and values are arrays of which the keys are |
Chris@0 | 42 * plugin IDs and the values are plugin definitions. |
Chris@0 | 43 */ |
Chris@0 | 44 public function getGroupedDefinitions(array $definitions = NULL); |
Chris@0 | 45 |
Chris@0 | 46 } |