You are here

public function EntityUrlGeneratorBase::generate in Simple XML sitemap 8.3

Same name and namespace in other branches
  1. 4.x src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\EntityUrlGeneratorBase::generate()

Parameters

mixed $data_set:

Return value

array

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

Overrides UrlGeneratorBase::generate

1 method overrides EntityUrlGeneratorBase::generate()
EntityUrlGenerator::generate in src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php
@inheritdoc

File

src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php, line 206

Class

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

Namespace

Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator

Code

public function generate($data_set) {
  $path_data = $this
    ->processDataSet($data_set);
  if (isset($path_data['url']) && $path_data['url'] instanceof Url) {
    $url_object = $path_data['url'];
    unset($path_data['url']);
    return $this
      ->getUrlVariants($path_data, $url_object);
  }
  return FALSE !== $path_data ? [
    $path_data,
  ] : [];
}