You are here

public function UrlGeneratorBase::generate in Simple XML sitemap 8.2

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

Called by batch.

Parameters

array|null $data_sets:

Overrides UrlGeneratorInterface::generate

File

src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php, line 421

Class

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

Namespace

Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator

Code

public function generate($data_sets = NULL) {
  $data_sets = NULL !== $data_sets ? $data_sets : $this
    ->getDataSets();
  foreach ($this
    ->getBatchIterationElements($data_sets) as $id => $data_set) {
    $this
      ->setCurrentId($id);
    $path_data = $this
      ->processDataSet($data_set);
    if (!$path_data) {
      continue;
    }
    $this
      ->addUrl($path_data);
  }
  $this
    ->processSegment();
}