You are here

protected function UrlGeneratorBase::initializeBatch in Simple XML sitemap 8.2

Parameters

$max:

3 calls to UrlGeneratorBase::initializeBatch()
EntityMenuLinkContentUrlGenerator::getBatchIterationElements in src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php
@inheritdoc
EntityUrlGenerator::getBatchIterationElements in src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php
@inheritdoc
UrlGeneratorBase::getBatchIterationElements in src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php

File

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

Class

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

Namespace

Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator

Code

protected function initializeBatch($max) {
  $this
    ->setBatchResults($this
    ->getBatchResults());
  $this
    ->setChunkCount($this
    ->getChunkCount());
  $this
    ->setProcessedElements($this
    ->getProcessedElements());

  // Initialize sandbox for the batch process.
  if ($this
    ->isBatch()) {
    $this->context['sandbox']['progress'] = 0;
    $this->context['sandbox']['current_id'] = 0;
    $this->context['sandbox']['max'] = $max;
    $this->context['sandbox']['finished'] = 0;
  }
}