You are here

public function EntityMenuLinkContentUrlGenerator::getDataSets in Simple XML sitemap 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\EntityMenuLinkContentUrlGenerator::getDataSets()
  2. 4.x src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\EntityMenuLinkContentUrlGenerator::getDataSets()

@inheritdoc

Overrides UrlGeneratorBase::getDataSets

File

src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php, line 103

Class

EntityMenuLinkContentUrlGenerator
Class EntityMenuLinkContentUrlGenerator @package Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator

Namespace

Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator

Code

public function getDataSets() {
  $menu_names = [];
  $bundle_settings = $this->generator
    ->getBundleSettings();
  if (!empty($bundle_settings['menu_link_content'])) {
    foreach ($bundle_settings['menu_link_content'] as $bundle_name => $settings) {
      if ($settings['index']) {
        $menu_names[] = $bundle_name;
      }
    }
  }
  return $menu_names;
}