3 namespace Drupal\video_embed_field;
6 * Interface for the class that gathers the provider plugins.
8 interface ProviderManagerInterface {
11 * Get an options list suitable for form elements for provider selection.
14 * An array of options keyed by plugin ID with label values.
16 public function getProvidersOptionList();
19 * Load the provider plugin definitions from a FAPI options list value.
21 * @param array $options
22 * An array of options from a form API submission.
25 * An array of plugin definitions.
27 public function loadDefinitionsFromOptionList($options);
30 * Get the provider applicable to the given user input.
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.
37 * @return \Drupal\video_embed_field\ProviderPluginInterface|bool
38 * The relevant plugin or FALSE on failure.
40 public function filterApplicableDefinitions(array $definitions, $user_input);
43 * Load a provider from user input.
45 * @param string $input
46 * Input provided from a field.
48 * @return \Drupal\video_embed_field\ProviderPluginInterface|bool
51 public function loadProviderFromInput($input);
54 * Load a plugin definition from an input.
56 * @param string $input
60 * A plugin definition.
62 public function loadDefinitionFromInput($input);