You are here

interface FreelinkingManagerInterface in Freelinking 8.3

Same name and namespace in other branches
  1. 4.0.x src/FreelinkingManagerInterface.php \Drupal\freelinking\FreelinkingManagerInterface

Freelinking plugin manager interface.

Hierarchy

Expanded class hierarchy of FreelinkingManagerInterface

All classes that implement FreelinkingManagerInterface

1 file declares its use of FreelinkingManagerInterface
Freelinking.php in src/Plugin/Filter/Freelinking.php

File

src/FreelinkingManagerInterface.php, line 14

Namespace

Drupal\freelinking
View source
interface FreelinkingManagerInterface extends PluginManagerInterface {

  /**
   * Initialize method.
   *
   * @param \Traversable $namespaces
   *   An array of namespaces.
   * @param \Drupal\Core\Cache\CacheBackendInterface $cacheBackend
   *   The cache backend.
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler for alter functionality.
   * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
   *   The language manager.
   */
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cacheBackend, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager);

  /**
   * Get the plugin to use based on the indicator and a list of allowed plugins.
   *
   * @param string $indicator
   *   The indicator string to test.
   * @param array $allowed_plugins
   *   An indexed array of plugin names.
   * @param array $options
   *   The settings from the filter. This is an associative array.
   *
   * @return \Drupal\freelinking\Plugin\FreelinkingPluginInterface|false
   *   The plugin to use or FALSE if not found.
   *
   * @see \Drupal\freelinking\Plugin\Filter\Freelinking::process()
   */
  public function getPluginFromIndicator($indicator, array $allowed_plugins = [], array $options = []);

  /**
   * Build link structure for a plugin with target parameters.
   *
   * @param \Drupal\freelinking\Plugin\FreelinkingPluginInterface $plugin
   *   The freelinking plugin.
   * @param array $target
   *   The target array. @see ::parseTarget().
   *
   * @return mixed
   *   Either an array or a string.
   */
  public function buildLink(FreelinkingPluginInterface $plugin, array $target);

  /**
   * Parse link arguments from the target string.
   *
   * @param string $target
   *   The target string to parse arguments for the link.
   * @param string $langcode
   *   The language code i.e. "en".
   *
   * @return array
   *   Target arguments.
   */
  public function parseTarget($target, $langcode);

  /**
   * Create the error element when plugin not found.
   *
   * @param string $indicator
   *   The name of the failed indicator.
   *
   * @return array
   *   The render array to render the error element.
   */
  public function createErrorElement($indicator);

  /**
   * Create the render array for the respective Freelinking plugin.
   *
   * @param string $plugin_id
   *   The plugin ID.
   * @param string $target
   *   The target string to parse.
   * @param string $indicator
   *   The indicator string.
   * @param string $langcode
   *   The language code.
   * @param string $plugin_settings_string
   *   The plugin settings serialized as a string.
   * @param string $failover_settings_string
   *   The failover settings serialized as a string. Defaults to an empty array.
   *
   * @return array
   *   A render element.
   *
   * @todo Set cache contexts from plugin.
   * @todo Multilingual support.
   */
  public function createFreelinkElement($plugin_id, $target, $indicator, $langcode, $plugin_settings_string, $failover_settings_string);

}

Members

Namesort descending Modifiers Type Description Overrides
DiscoveryInterface::getDefinition public function Gets a specific plugin definition. 4
DiscoveryInterface::getDefinitions public function Gets the definition of all plugins for this type. 3
DiscoveryInterface::hasDefinition public function Indicates if a specific plugin definition exists. 2
FactoryInterface::createInstance public function Creates a pre-configured instance of a plugin. 7
FreelinkingManagerInterface::buildLink public function Build link structure for a plugin with target parameters. 1
FreelinkingManagerInterface::createErrorElement public function Create the error element when plugin not found. 1
FreelinkingManagerInterface::createFreelinkElement public function Create the render array for the respective Freelinking plugin. 1
FreelinkingManagerInterface::getPluginFromIndicator public function Get the plugin to use based on the indicator and a list of allowed plugins. 1
FreelinkingManagerInterface::parseTarget public function Parse link arguments from the target string. 1
FreelinkingManagerInterface::__construct public function Initialize method.
MapperInterface::getInstance public function Gets a preconfigured instance of a plugin. 4