Commit f105e99e authored by gbyte.co's avatar gbyte.co

Clean up

parent ad011743
......@@ -10,7 +10,7 @@ use Drupal\Core\Cache\Cache;
* @package Drupal\simple_sitemap\Batch
*
* The services of this class are not injected, as this class looses its state
* on every method call because of how the batch APi works.
* on every method call because of how the batch API works.
*/
class Batch {
......@@ -135,13 +135,15 @@ class Batch {
public static function finishGeneration($success, $results, $operations) {
if ($success) {
Cache::invalidateTags(['simple_sitemap']);
\Drupal::service('simple_sitemap.logger')->m(self::REGENERATION_FINISHED_MESSAGE)
\Drupal::service('simple_sitemap.logger')
->m(self::REGENERATION_FINISHED_MESSAGE)
// ['@url' => $this->sitemapGenerator->getCustomBaseUrl() . '/sitemap.xml']) //todo: Use actual base URL for message.
->display('status')
->log('info');
}
else {
\Drupal::service('simple_sitemap.logger')->m(self::REGENERATION_FINISHED_ERROR_MESSAGE)
\Drupal::service('simple_sitemap.logger')
->m(self::REGENERATION_FINISHED_ERROR_MESSAGE)
->display('error', 'administer sitemap settings')
->log('error');
}
......
......@@ -272,6 +272,7 @@ class Simplesitemap {
/**
* @param $name
* @param $definition
* @return $this
*
* @todo document
*/
......@@ -286,10 +287,13 @@ class Simplesitemap {
}
}
$type->save();
return $this;
}
/**
* @param $name
* @return $this
*
* @todo document
*/
......@@ -300,6 +304,8 @@ class Simplesitemap {
else {
//todo: exception
}
return $this;
}
/**
......@@ -447,12 +453,13 @@ class Simplesitemap {
}
/**
* @param null|array $variant
* @param null $variant
* @return $this
*
* @todo Add removeSitemap API method.
* @todo implement
*/
public function removeSitemap($variant = NULL) {
return $this;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment