More tidying.
[yaffs-website] / web / modules / contrib / video_embed_field / src / ProviderManagerInterface.php
1 <?php
2
3 namespace Drupal\video_embed_field;
4
5 /**
6  * Interface for the class that gathers the provider plugins.
7  */
8 interface ProviderManagerInterface {
9
10   /**
11    * Get an options list suitable for form elements for provider selection.
12    *
13    * @return array
14    *   An array of options keyed by plugin ID with label values.
15    */
16   public function getProvidersOptionList();
17
18   /**
19    * Load the provider plugin definitions from a FAPI options list value.
20    *
21    * @param array $options
22    *   An array of options from a form API submission.
23    *
24    * @return array
25    *   An array of plugin definitions.
26    */
27   public function loadDefinitionsFromOptionList($options);
28
29   /**
30    * Get the provider applicable to the given user input.
31    *
32    * @param array $definitions
33    *   A list of definitions to test against.
34    * @param string $user_input
35    *   The user input to test against the plugins.
36    *
37    * @return \Drupal\video_embed_field\ProviderPluginInterface|bool
38    *   The relevant plugin or FALSE on failure.
39    */
40   public function filterApplicableDefinitions(array $definitions, $user_input);
41
42   /**
43    * Load a provider from user input.
44    *
45    * @param string $input
46    *   Input provided from a field.
47    *
48    * @return \Drupal\video_embed_field\ProviderPluginInterface|bool
49    *   The loaded plugin.
50    */
51   public function loadProviderFromInput($input);
52
53   /**
54    * Load a plugin definition from an input.
55    *
56    * @param string $input
57    *   An input string.
58    *
59    * @return array
60    *   A plugin definition.
61    */
62   public function loadDefinitionFromInput($input);
63
64 }