You are here

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

Get the number of rows in the index.

Parameters

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

Return value

int The number of rows.

1 call to SimpleSitemapViews::getArgumentsFromIndexCount()
SimpleSitemapViews::addArgumentsToIndex in src/SimpleSitemapViews.php
Adds view arguments to the index.

File

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

Class

SimpleSitemapViews
Class to manage sitemap data for views.

Namespace

Drupal\simple_sitemap_views

Code

public function getArgumentsFromIndexCount(ConditionInterface $condition = NULL) {
  $query = $this->database
    ->select('simple_sitemap_views', 'ssv');

  // Add conditions if necessary.
  if (!empty($condition)) {
    $query
      ->condition($condition);
  }

  // Get the number of rows from the index table.
  return $query
    ->countQuery()
    ->execute()
    ->fetchField();
}