You are here

public function SimpleSitemapViews::removeArgumentsFromIndex in Simple XML sitemap (Views integration) 8

Remove arguments from index.

Parameters

\Drupal\Core\Database\Query\ConditionInterface|null $condition: The query conditions.

File

src/SimpleSitemapViews.php, line 255
Contains simple_sitemap_views service.

Class

SimpleSitemapViews
Class to manage sitemap data for views.

Namespace

Drupal\simple_sitemap_views

Code

public function removeArgumentsFromIndex(ConditionInterface $condition = NULL) {
  if (empty($condition)) {

    // If there are no conditions, use the TRUNCATE query.
    $query = $this->database
      ->truncate('simple_sitemap_views');
  }
  else {

    // Otherwise, use the DELETE query.
    $query = $this->database
      ->delete('simple_sitemap_views');
    $query
      ->condition($condition);
  }
  $query
    ->execute();
}