You are here

function search_api_search_api_server_insert in Search API 7

Implements hook_search_api_server_insert().

Calls the postCreate() method for the server.

File

./search_api.module, line 587
Provides a flexible framework for implementing search services.

Code

function search_api_search_api_server_insert(SearchApiServer $server) {

  // Check whether this is actually part of a revert.
  $reverts =& drupal_static('search_api_search_api_server_delete', array());
  if (isset($reverts[$server->machine_name])) {
    $server->original = $reverts[$server->machine_name];
    unset($reverts[$server->machine_name]);
    search_api_search_api_server_update($server);
    unset($server->original);
    return;
  }
  $server
    ->postCreate();
}