You are here

function search_api_entity_delete in Search API 7

Same name and namespace in other branches
  1. 8 search_api.module \search_api_entity_delete()

Implements hook_entity_delete().

This is implemented on behalf of the SearchApiEntityDataSourceController datasource controller and calls search_api_track_item_delete() for the deleted items.

See also

search_api_search_api_item_type_info()

File

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

Code

function search_api_entity_delete($entity, $type) {

  // We only react on entity operations for types with property information, as
  // we don't provide search integration for the others.
  if (!entity_get_property_info($type)) {
    return;
  }
  list($id) = entity_extract_ids($type, $entity);
  if (isset($id)) {
    search_api_track_item_delete($type, array(
      $id,
    ));
    $combined_id = $type . '/' . $id;
    search_api_track_item_delete('multiple', array(
      $combined_id,
    ));
  }
}