abstract class LinkExtractorBase in Link checker 8
Base class for Link extractor plugins.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\linkchecker\Plugin\LinkExtractorBase implements ContainerFactoryPluginInterface, LinkExtractorInterface
Expanded class hierarchy of LinkExtractorBase
2 files declare their use of LinkExtractorBase
- HtmlLinkExtractor.php in src/
Plugin/ LinkExtractor/ HtmlLinkExtractor.php - LinkLinkExtractor.php in src/
Plugin/ LinkExtractor/ LinkLinkExtractor.php
File
- src/
Plugin/ LinkExtractorBase.php, line 13
Namespace
Drupal\linkchecker\PluginView source
abstract class LinkExtractorBase extends PluginBase implements LinkExtractorInterface, ContainerFactoryPluginInterface {
/**
* The Linkchecker settings.
*
* @var \Drupal\Core\Config\ImmutableConfig
*/
protected $linkcheckerSetting;
/**
* LinkExtractorBase plugin constructor.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, ImmutableConfig $config) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->linkcheckerSetting = $config;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('config.factory')
->get('linkchecker.settings'));
}
/**
* Extracts a URLs from field.
*
* @return array
* Array of URLs.
*/
protected abstract function extractUrlFromField(array $value);
/**
* {@inheritdoc}
*/
public function extract(array $value) {
$urls = [];
foreach ($value as $item) {
$urls = array_merge($urls, $this
->extractUrlFromField($item));
}
return $urls;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LinkExtractorBase:: |
protected | property | The Linkchecker settings. | |
LinkExtractorBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
LinkExtractorBase:: |
public | function |
Extracts links from field list. Overrides LinkExtractorInterface:: |
|
LinkExtractorBase:: |
abstract protected | function | Extracts a URLs from field. | 2 |
LinkExtractorBase:: |
public | function |
LinkExtractorBase plugin constructor. Overrides PluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. |