You are here

function apachesolr_entity_delete in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_entity_delete()
  2. 6.3 apachesolr.module \apachesolr_entity_delete()

Implements hook_entity_delete().

Delete the entity's entry from a fictional table of all entities.

1 call to apachesolr_entity_delete()
apachesolr_entity_update in ./apachesolr.module
Implements hook_entity_update().

File

./apachesolr.module, line 2073
Integration with the Apache Solr search application.

Code

function apachesolr_entity_delete($entity, $entity_type) {
  list($entity_id) = entity_extract_ids($entity_type, $entity);
  if (apachesolr_entity_should_index($entity, $entity_type)) {

    // Get all environments and delete it from their table and index
    $environments = apachesolr_load_all_environments();
    foreach ($environments as $environment) {
      apachesolr_remove_entity($environment['env_id'], $entity_type, $entity_id);
    }
  }
}