entity_revision_delete

entity_revision_delete($entity_type, $revision_id)

Deletes an entity revision.

\Drupal::entityTypeManager()
  ->getStorage($entity_type)
  ->deleteRevision($revision_id);

Parameters

string $entity_type: The entity type to load, e.g. node or user.

$revision_id: The revision ID to delete.

Deprecated

as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Use the entity storage's deleteRevision() method to delete a specific entity revision:

See also

\Drupal\Core\Entity\EntityTypeManagerInterface::getStorage()

\Drupal\Core\Entity\EntityStorageInterface::deleteRevision()

File

core/includes/entity.inc, line 139
Entity API for handling entities like nodes or users.

Code

function entity_revision_delete($entity_type, $revision_id) {
  \Drupal::entityManager()
    ->getStorage($entity_type)
    ->deleteRevision($revision_id);
}
doc_Drupal
2016-10-29 09:09:16
Comments
Leave a Comment

Please login to continue.