public function EntityOperations::entityDelete in Drupal 9
Same name and namespace in other branches
- 8 core/modules/content_moderation/src/EntityOperations.php \Drupal\content_moderation\EntityOperations::entityDelete()
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity being deleted.
See also
File
- core/
modules/ content_moderation/ src/ EntityOperations.php, line 224
Class
- EntityOperations
- Defines a class for reacting to entity events.
Namespace
Drupal\content_moderationCode
public function entityDelete(EntityInterface $entity) {
$content_moderation_state = ContentModerationStateEntity::loadFromModeratedEntity($entity);
if ($content_moderation_state) {
$content_moderation_state
->delete();
}
}