You are here

public function EntityOperations::entityDelete in Config Entity Revisions 8.2

Respond to deletion of an entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity being deleted.

See also

hook_entity_delete()

File

src/EntityOperations.php, line 241

Class

EntityOperations
Defines a class for reacting to entity events.

Namespace

Drupal\config_entity_revisions

Code

public function entityDelete(EntityInterface $entity) {
  $content_moderation_state = ContentModerationStateEntity::loadFromModeratedEntity($entity);
  if ($content_moderation_state) {
    $content_moderation_state
      ->delete();
  }
}