You are here

public function TaskManager::getTasksCount in Search API 8

Retrieves the number of pending tasks for the given conditions.

Parameters

array $conditions: (optional) An array of conditions to be matched for the tasks, with property names mapped to the value (or values, for multiple possibilities) that the property should have.

Return value

int The number of pending tasks matching the conditions.

Overrides TaskManagerInterface::getTasksCount

2 calls to TaskManager::getTasksCount()
TaskManager::executeAllTasks in src/Task/TaskManager.php
Executes all (or some) pending tasks.
TaskManager::processBatch in src/Task/TaskManager.php
Processes a single pending task as part of a batch operation.

File

src/Task/TaskManager.php, line 126

Class

TaskManager
Provides a service for managing pending tasks.

Namespace

Drupal\search_api\Task

Code

public function getTasksCount(array $conditions = []) {
  return $this
    ->getTasksQuery($conditions)
    ->count()
    ->execute();
}