You are here

public static function BatchTrait::finishGeneration in Simple XML sitemap 4.x

Same name and namespace in other branches
  1. 8.3 src/Queue/BatchTrait.php \Drupal\simple_sitemap\Queue\BatchTrait::finishGeneration()

Callback function called by the batch API when all operations are finished.

Parameters

bool $success:

array $results:

array $operations:

Return value

bool

See also

https://api.drupal.org/api/drupal/core!includes!form.inc/group/batch/8

File

src/Queue/BatchTrait.php, line 85

Class

BatchTrait

Namespace

Drupal\simple_sitemap\Queue

Code

public static function finishGeneration(bool $success, array $results, array $operations) : bool {
  if ($success) {
    \Drupal::service('simple_sitemap.logger')
      ->m('The XML sitemaps have been regenerated.')
      ->log('info');
  }
  else {
    \Drupal::service('simple_sitemap.logger')
      ->m(self::$batchErrorMessage)
      ->display('error', 'administer sitemap settings')
      ->log('error');
  }
  return $success;
}