class VocabularySitemapDeriver in Sitemap 2.0.x
Same name and namespace in other branches
- 8.2 src/Plugin/Derivative/VocabularySitemapDeriver.php \Drupal\sitemap\Plugin\Derivative\VocabularySitemapDeriver
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\sitemap\Plugin\Derivative\VocabularySitemapDeriver implements ContainerDeriverInterface
Expanded class hierarchy of VocabularySitemapDeriver
File
- src/
Plugin/ Derivative/ VocabularySitemapDeriver.php, line 13
Namespace
Drupal\sitemap\Plugin\DerivativeView source
class VocabularySitemapDeriver extends DeriverBase implements ContainerDeriverInterface {
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static();
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
if (\Drupal::moduleHandler()
->moduleExists('taxonomy')) {
foreach (Vocabulary::loadMultiple() as $id => $vocabulary) {
/* @var $vocabulary \Drupal\taxonomy\VocabularyInterface */
$this->derivatives[$id] = $base_plugin_definition;
$this->derivatives[$id]['title'] = t('Vocabulary: @vocabulary', [
'@vocabulary' => $vocabulary
->label(),
]);
$this->derivatives[$id]['description'] = $vocabulary
->getDescription();
$this->derivatives[$id]['settings']['title'] = '';
$this->derivatives[$id]['vocabulary'] = $vocabulary
->id();
$this->derivatives[$id]['config_dependencies']['config'] = [
$vocabulary
->getConfigDependencyName(),
];
}
}
return $this->derivatives;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
VocabularySitemapDeriver:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
VocabularySitemapDeriver:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |