You are here

public function TaskManager::deleteTask in Search API 8

Deletes the task with the given ID.

Parameters

int $task_id: The task's ID.

Overrides TaskManagerInterface::deleteTask

File

src/Task/TaskManager.php, line 180

Class

TaskManager
Provides a service for managing pending tasks.

Namespace

Drupal\search_api\Task

Code

public function deleteTask($task_id) {
  $task = $this
    ->getTaskStorage()
    ->load($task_id);
  if ($task) {
    $task
      ->delete();
  }
}