You are here

function xmlsitemap_entity_delete in XML sitemap 8

Same name and namespace in other branches
  1. 2.x xmlsitemap.module \xmlsitemap_entity_delete()

Implements hook_entity_delete().

File

./xmlsitemap.module, line 1730
xmlsitemap XML sitemap

Code

function xmlsitemap_entity_delete(EntityInterface $entity) {
  $langcode = $entity
    ->language() ? $entity
    ->language()
    ->getId() : NULL;
  \Drupal::service('xmlsitemap.link_storage')
    ->delete($entity
    ->getEntityTypeId(), $entity
    ->id(), $langcode);
}