You are here

function hook_search_api_datasource_info_alter in Search API 8

Alter the available datasources.

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

Parameters

array $infos: The datasource info array, keyed by datasource IDs.

Deprecated

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

See also

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

\Drupal\search_api\Datasource\DatasourcePluginBase

1 function implements hook_search_api_datasource_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_datasource_info_alter in tests/search_api_test_hooks/search_api_test_hooks.search_api.inc
Implements hook_search_api_datasource_info_alter().
1 invocation of hook_search_api_datasource_info_alter()
DatasourcePluginManager::__construct in src/Datasource/DatasourcePluginManager.php
Constructs a DatasourcePluginManager object.

File

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

Code

function hook_search_api_datasource_info_alter(array &$infos) {

  // I'm a traditionalist, I want them called "nodes"!
  $infos['entity:node']['label'] = t('Node');
}