You are here

function gatsby_fastbuilds_entity_delete in Gatsby Live Preview & Incremental Builds 2.0.x

Same name and namespace in other branches
  1. 8 modules/gatsby_fastbuilds/gatsby_fastbuilds.module \gatsby_fastbuilds_entity_delete()

Implements hook_entity_delete().

File

modules/gatsby_fastbuilds/gatsby_fastbuilds.module, line 66
Contains gatsby_fastbuilds.module.

Code

function gatsby_fastbuilds_entity_delete(EntityInterface $entity) {
  $gatsbyPreview = \Drupal::service('gatsby.gatsby_preview');
  if (!$entity instanceof ContentEntityInterface || !$gatsbyPreview
    ->isPreviewEntity($entity)) {
    return;
  }
  \Drupal::service('gatsby.gatsby_logger')
    ->logEntity($entity, 'delete');
}