You are here

function hook_search_api_backend_info_alter in Search API 8

Alter the available Search API backends.

Modules may implement this hook to alter the information that defines Search API backends. All properties that are available in \Drupal\search_api\Annotation\SearchApiBackend can be altered here, with the addition of the "class" and "provider" keys.

Parameters

array $backend_info: The Search API backend info array, keyed by backend ID.

Deprecated

in search_api:8.x-1.14 and is removed from search_api:2.0.0. Please use the "search_api.gathering_backends" event instead.

See also

https://www.drupal.org/node/3059866

\Drupal\search_api\Backend\BackendPluginBase

1 function implements hook_search_api_backend_info_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

search_api_test_hooks_search_api_backend_info_alter in tests/search_api_test_hooks/search_api_test_hooks.search_api.inc
Implements hook_search_api_backend_info_alter().
1 invocation of hook_search_api_backend_info_alter()
BackendPluginManager::__construct in src/Backend/BackendPluginManager.php
Constructs a BackendPluginManager object.

File

./search_api.api.php, line 30
Hooks provided by the Search API module.

Code

function hook_search_api_backend_info_alter(array &$backend_info) {
  foreach ($backend_info as $id => $info) {
    $backend_info[$id]['class'] = '\\Drupal\\my_module\\MyBackendDecorator';
    $backend_info[$id]['example_original_class'] = $info['class'];
  }
}