Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Component / Plugin / Discovery / DiscoveryInterface.php
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    * @see \Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions()
38    */
39   public function getDefinitions();
40
41   /**
42    * Indicates if a specific plugin definition exists.
43    *
44    * @param string $plugin_id
45    *   A plugin ID.
46    *
47    * @return bool
48    *   TRUE if the definition exists, FALSE otherwise.
49    */
50   public function hasDefinition($plugin_id);
51
52 }