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