You are here

public function QueueWorker::getQueuedElementCount in Simple XML sitemap 4.x

Same name and namespace in other branches
  1. 8.3 src/Queue/QueueWorker.php \Drupal\simple_sitemap\Queue\QueueWorker::getQueuedElementCount()

Parameters

bool $force_recount:

Return value

int

4 calls to QueueWorker::getQueuedElementCount()
QueueWorker::generateSitemap in src/Queue/QueueWorker.php
QueueWorker::generationInProgress in src/Queue/QueueWorker.php
QueueWorker::getProcessedElementCount in src/Queue/QueueWorker.php
QueueWorker::queue in src/Queue/QueueWorker.php

File

src/Queue/QueueWorker.php, line 396

Class

QueueWorker

Namespace

Drupal\simple_sitemap\Queue

Code

public function getQueuedElementCount(bool $force_recount = FALSE) : ?int {
  if ($force_recount || NULL === $this->elementsRemaining) {
    $this->elementsRemaining = $this->queue
      ->numberOfItems();
  }
  return $this->elementsRemaining;
}