3 namespace Drupal\Core\Entity;
6 * A storage that supports revisionable entity types.
8 interface RevisionableStorageInterface {
11 * Creates a new revision starting off from the specified entity object.
13 * @param \Drupal\Core\Entity\EntityInterface|\Drupal\Core\Entity\RevisionableInterface $entity
14 * The revisionable entity object being modified.
15 * @param bool $default
16 * (optional) Whether the new revision should be marked as default. Defaults
19 * @return \Drupal\Core\Entity\EntityInterface|\Drupal\Core\Entity\RevisionableInterface
20 * A new entity revision object.
22 public function createRevision(RevisionableInterface $entity, $default = TRUE);
25 * Loads a specific entity revision.
27 * @param int $revision_id
30 * @return \Drupal\Core\Entity\EntityInterface|null
31 * The specified entity revision or NULL if not found.
33 public function loadRevision($revision_id);
36 * Loads multiple entity revisions.
38 * @param array $revision_ids
39 * An array of revision IDs to load.
41 * @return \Drupal\Core\Entity\EntityInterface[]
42 * An array of entity revisions keyed by their revision ID, or an empty
43 * array if none found.
45 public function loadMultipleRevisions(array $revision_ids);
48 * Deletes a specific entity revision.
50 * A revision can only be deleted if it's not the currently active one.
52 * @param int $revision_id
55 public function deleteRevision($revision_id);
58 * Returns the latest revision identifier for an entity.
60 * @param int|string $entity_id
61 * The entity identifier.
63 * @return int|string|null
64 * The latest revision identifier or NULL if no revision could be found.
66 public function getLatestRevisionId($entity_id);