You are here

public function TaskManagerInterface::addTask in Search API 8

Adds a new pending task.

In case this would duplicate an existing task, that existing task is returned instead.

Parameters

string $type: The type of task.

\Drupal\search_api\ServerInterface|null $server: (optional) The search server associated with the task, if any.

\Drupal\search_api\IndexInterface|null $index: (optional) The search index associated with the task, if any.

mixed|null $data: (optional) Additional, type-specific data to save with the task.

Return value

\Drupal\search_api\Task\TaskInterface The new task, or an identical existing task.

1 method overrides TaskManagerInterface::addTask()
TaskManager::addTask in src/Task/TaskManager.php
Adds a new pending task.

File

src/Task/TaskManagerInterface.php, line 44

Class

TaskManagerInterface
Defines the interface of the Search API task manager service.

Namespace

Drupal\search_api\Task

Code

public function addTask($type, ServerInterface $server = NULL, IndexInterface $index = NULL, $data = NULL);