You are here

public function SimpleSitemapStorage::purgeContent in Simple XML sitemap 4.x

1 call to SimpleSitemapStorage::purgeContent()
SimpleSitemapStorage::deleteContent in src/Entity/SimpleSitemapStorage.php

File

src/Entity/SimpleSitemapStorage.php, line 327

Class

SimpleSitemapStorage

Namespace

Drupal\simple_sitemap\Entity

Code

public function purgeContent($variants = NULL, ?bool $status = SimpleSitemap::FETCH_BY_STATUS_ALL) : void {
  $query = \Drupal::database()
    ->delete('simple_sitemap');
  if ($status !== SimpleSitemap::FETCH_BY_STATUS_ALL) {
    $query
      ->condition('status', $status);
  }
  if ($variants !== NULL) {
    $query
      ->condition('type', (array) $variants, 'IN');
  }
  $query
    ->execute();
}