You are here

public function TestBackend::addIndex in Search API 8

Adds a new index to this server.

If the index was already added to the server, the object should treat this as if removeIndex() and then addIndex() were called.

Parameters

\Drupal\search_api\IndexInterface $index: The index to add.

Throws

\Drupal\search_api\SearchApiException Thrown if an error occurred while adding the index.

Overrides BackendPluginBase::addIndex

File

tests/search_api_test/src/Plugin/search_api/backend/TestBackend.php, line 152

Class

TestBackend
Provides a dummy backend for testing purposes.

Namespace

Drupal\search_api_test\Plugin\search_api\backend

Code

public function addIndex(IndexInterface $index) {
  if ($override = $this
    ->getMethodOverride(__FUNCTION__)) {
    call_user_func($override, $this, $index);
    return;
  }
  $this
    ->checkError(__FUNCTION__);
}