You are here

function search_api_grouping_entity_delete in Search API Grouping 7.2

Implements hook_entity_delete().

Removes the item from the tracking table and deletes it from all indexes.

File

./search_api_grouping.module, line 164
Module search_api_grouping.

Code

function search_api_grouping_entity_delete($entity, $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($entity_type)) {
    return;
  }
  $index_type = search_api_grouping_get_type($entity_type);
  $ids = search_api_grouping_get_ids($entity_type, $entity);
  if (!empty($ids)) {
    search_api_track_item_delete($index_type, array_keys($ids));
  }
}