You are here

function entity_revision_delete in Entity API 7

Deletes an entity revision.

Parameters

$entity_type: The type of the entity.

$revision_id: The revision ID to delete.

Return value

bool TRUE if the entity revision could be deleted, FALSE otherwise.

1 call to entity_revision_delete()
EntityAPITestCase::testCRUDRevisisions in ./entity.test
Tests CRUD for entities supporting revisions.

File

./entity.module, line 382

Code

function entity_revision_delete($entity_type, $revision_id) {
  $info = entity_get_info($entity_type);
  if (isset($info['revision deletion callback'])) {
    return $info['revision deletion callback']($revision_id, $entity_type);
  }
  elseif (in_array('EntityAPIControllerRevisionableInterface', class_implements($info['controller class']))) {
    return entity_get_controller($entity_type)
      ->deleteRevision($revision_id);
  }
  return FALSE;
}