You are here

interface ProviderManagerInterface in Video Embed Field 8

Same name and namespace in other branches
  1. 8.2 src/ProviderManagerInterface.php \Drupal\video_embed_field\ProviderManagerInterface

Interface for the class that gathers the provider plugins.

Hierarchy

Expanded class hierarchy of ProviderManagerInterface

All classes that implement ProviderManagerInterface

5 files declare their use of ProviderManagerInterface
Thumbnail.php in src/Plugin/Field/FieldFormatter/Thumbnail.php
Video.php in src/Plugin/Field/FieldFormatter/Video.php
VideoEmbedConstraintValidator.php in src/Plugin/Validation/Constraint/VideoEmbedConstraintValidator.php
VideoEmbedField.php in modules/video_embed_media/src/Plugin/MediaEntity/Type/VideoEmbedField.php
VideoEmbedWysiwyg.php in modules/video_embed_wysiwyg/src/Plugin/Filter/VideoEmbedWysiwyg.php

File

src/ProviderManagerInterface.php, line 8

Namespace

Drupal\video_embed_field
View source
interface ProviderManagerInterface {

  /**
   * Get an options list suitable for form elements for provider selection.
   *
   * @return array
   *   An array of options keyed by plugin ID with label values.
   */
  public function getProvidersOptionList();

  /**
   * Load the provider plugin definitions from a FAPI options list value.
   *
   * @param array $options
   *   An array of options from a form API submission.
   *
   * @return array
   *   An array of plugin definitions.
   */
  public function loadDefinitionsFromOptionList($options);

  /**
   * Get the provider applicable to the given user input.
   *
   * @param array $definitions
   *   A list of definitions to test against.
   * @param string $user_input
   *   The user input to test against the plugins.
   *
   * @return \Drupal\video_embed_field\ProviderPluginInterface|bool
   *   The relevant plugin or FALSE on failure.
   */
  public function filterApplicableDefinitions(array $definitions, $user_input);

  /**
   * Load a provider from user input.
   *
   * @param string $input
   *   Input provided from a field.
   *
   * @return \Drupal\video_embed_field\ProviderPluginInterface|bool
   *   The loaded plugin.
   */
  public function loadProviderFromInput($input);

  /**
   * Load a plugin definition from an input.
   *
   * @param string $input
   *   An input string.
   *
   * @return array
   *   A plugin definition.
   */
  public function loadDefinitionFromInput($input);

}

Members

Namesort descending Modifiers Type Description Overrides
ProviderManagerInterface::filterApplicableDefinitions public function Get the provider applicable to the given user input. 1
ProviderManagerInterface::getProvidersOptionList public function Get an options list suitable for form elements for provider selection. 1
ProviderManagerInterface::loadDefinitionFromInput public function Load a plugin definition from an input. 1
ProviderManagerInterface::loadDefinitionsFromOptionList public function Load the provider plugin definitions from a FAPI options list value. 1
ProviderManagerInterface::loadProviderFromInput public function Load a provider from user input. 1