class ArbitraryUrlGenerator in Simple XML sitemap 8.2
Same name and namespace in other branches
- 8.3 src/Plugin/simple_sitemap/UrlGenerator/ArbitraryUrlGenerator.php \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\ArbitraryUrlGenerator
Class ArbitraryUrlGenerator @package Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator
Plugin annotation
@UrlGenerator(
id = "arbitrary",
title = @Translation("Arbitrary URL generator"),
description = @Translation("Generates URLs from data sets collected in the hook_arbitrary_links_alter hook."),
weight = 20,
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\simple_sitemap\Plugin\simple_sitemap\SimplesitemapPluginBase implements PluginInspectionInterface, ContainerFactoryPluginInterface
- class \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGeneratorPluginBase implements ConfigurablePluginInterface
- class \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\UrlGeneratorBase implements UrlGeneratorInterface
- class \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\ArbitraryUrlGenerator
- class \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\UrlGeneratorBase implements UrlGeneratorInterface
- class \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGeneratorPluginBase implements ConfigurablePluginInterface
- class \Drupal\simple_sitemap\Plugin\simple_sitemap\SimplesitemapPluginBase implements PluginInspectionInterface, ContainerFactoryPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of ArbitraryUrlGenerator
File
- src/
Plugin/ simple_sitemap/ UrlGenerator/ ArbitraryUrlGenerator.php, line 25
Namespace
Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGeneratorView source
class ArbitraryUrlGenerator extends UrlGeneratorBase {
protected $moduleHandler;
/**
* ArbitraryUrlGenerator constructor.
* @param array $configuration
* @param string $plugin_id
* @param mixed $plugin_definition
* @param \Drupal\simple_sitemap\Simplesitemap $generator
* @param \Drupal\simple_sitemap\SitemapGenerator $sitemap_generator
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* @param \Drupal\simple_sitemap\Logger $logger
* @param \Drupal\simple_sitemap\EntityHelper $entityHelper
* @param \Drupal\Core\Extension\ModuleHandler $module_handler
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, Simplesitemap $generator, SitemapGenerator $sitemap_generator, LanguageManagerInterface $language_manager, EntityTypeManagerInterface $entity_type_manager, Logger $logger, EntityHelper $entityHelper, ModuleHandler $module_handler) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $generator, $sitemap_generator, $language_manager, $entity_type_manager, $logger, $entityHelper);
$this->moduleHandler = $module_handler;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('simple_sitemap.generator'), $container
->get('simple_sitemap.sitemap_generator'), $container
->get('language_manager'), $container
->get('entity_type.manager'), $container
->get('simple_sitemap.logger'), $container
->get('simple_sitemap.entity_helper'), $container
->get('module_handler'));
}
/**
* @inheritdoc
*/
public function getDataSets() {
$arbitrary_links = [];
$this->moduleHandler
->alter('simple_sitemap_arbitrary_links', $arbitrary_links);
return array_values($arbitrary_links);
}
/**
* @inheritdoc
*/
protected function processDataSet($data_set) {
return $data_set;
}
}