function search_api_index_get_server in Search API 7
Returns an index's server.
Used as a property getter callback for the index's "server_entity" prioperty in search_api_entity_property_info().
Parameters
SearchApiIndex $index: The index whose server should be returned.
Return value
SearchApiServer|null The server this index currently resides on, or NULL if the index is currently unassigned.
1 string reference to 'search_api_index_get_server'
- search_api_entity_property_info in ./
search_api.module - Implements hook_entity_property_info().
File
- ./
search_api.module, line 2885 - Provides a flexible framework for implementing search services.
Code
function search_api_index_get_server(SearchApiIndex $index) {
try {
return $index
->server();
} catch (SearchApiException $e) {
watchdog_exception('search_api', $e);
return NULL;
}
}