You are here

function simple_sitemap_entity_delete in Simple XML sitemap 8.2

Same name and namespace in other branches
  1. 8.3 simple_sitemap.module \simple_sitemap_entity_delete()
  2. 4.x simple_sitemap.module \simple_sitemap_entity_delete()

Implements hook_entity_delete().

Removes settings of the removed entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity:

File

./simple_sitemap.module, line 189
Main module file containing hooks.

Code

function simple_sitemap_entity_delete(EntityInterface $entity) {

  /**
   * @var \Drupal\simple_sitemap\Simplesitemap $generator
   */
  $generator = \Drupal::service('simple_sitemap.generator');
  $generator
    ->removeEntityInstanceSettings($entity
    ->getEntityTypeId(), $entity
    ->id());
}