You are here

public function SimpleSitemapViews::addArgumentsToIndex in Simple XML sitemap 8.3

Same name and namespace in other branches
  1. 4.x modules/simple_sitemap_views/src/SimpleSitemapViews.php \Drupal\simple_sitemap_views\SimpleSitemapViews::addArgumentsToIndex()

Adds view arguments to the index.

Parameters

\Drupal\views\ViewExecutable $view: A view executable instance.

array $args: Array of arguments to add to the index.

string|null $display_id: The display id. If empty uses the current display.

Return value

bool TRUE if the arguments are added to the index, FALSE otherwise.

File

modules/simple_sitemap_views/src/SimpleSitemapViews.php, line 253

Class

SimpleSitemapViews
Class to manage sitemap data for views.

Namespace

Drupal\simple_sitemap_views

Code

public function addArgumentsToIndex(ViewExecutable $view, array $args, $display_id = NULL) {
  $variants = $this->sitemapManager
    ->getSitemapVariants(NULL, FALSE);
  foreach (array_keys($variants) as $variant) {
    $result = $this
      ->addArgumentsToIndexByVariant($view, $variant, $args, $display_id);
    if ($result) {
      return $result;
    }
  }
  return FALSE;
}