Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Component/Plugin/Discovery/DiscoveryInterface.php @ 0:4c8ae668cc8c
Initial import (non-working)
| author | Chris Cannam |
|---|---|
| date | Wed, 29 Nov 2017 16:09:58 +0000 |
| parents | |
| children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4c8ae668cc8c |
|---|---|
| 1 <?php | |
| 2 | |
| 3 namespace Drupal\Component\Plugin\Discovery; | |
| 4 | |
| 5 /** | |
| 6 * An interface defining the minimum requirements of building a plugin | |
| 7 * discovery component. | |
| 8 * | |
| 9 * @ingroup plugin_api | |
| 10 */ | |
| 11 interface DiscoveryInterface { | |
| 12 | |
| 13 /** | |
| 14 * Gets a specific plugin definition. | |
| 15 * | |
| 16 * @param string $plugin_id | |
| 17 * A plugin id. | |
| 18 * @param bool $exception_on_invalid | |
| 19 * (optional) If TRUE, an invalid plugin ID will throw an exception. | |
| 20 * | |
| 21 * @return mixed | |
| 22 * A plugin definition, or NULL if the plugin ID is invalid and | |
| 23 * $exception_on_invalid is FALSE. | |
| 24 * | |
| 25 * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException | |
| 26 * Thrown if $plugin_id is invalid and $exception_on_invalid is TRUE. | |
| 27 */ | |
| 28 public function getDefinition($plugin_id, $exception_on_invalid = TRUE); | |
| 29 | |
| 30 /** | |
| 31 * Gets the definition of all plugins for this type. | |
| 32 * | |
| 33 * @return mixed[] | |
| 34 * An array of plugin definitions (empty array if no definitions were | |
| 35 * found). Keys are plugin IDs. | |
| 36 */ | |
| 37 public function getDefinitions(); | |
| 38 | |
| 39 /** | |
| 40 * Indicates if a specific plugin definition exists. | |
| 41 * | |
| 42 * @param string $plugin_id | |
| 43 * A plugin ID. | |
| 44 * | |
| 45 * @return bool | |
| 46 * TRUE if the definition exists, FALSE otherwise. | |
| 47 */ | |
| 48 public function hasDefinition($plugin_id); | |
| 49 | |
| 50 } |
