To be able to group together all entity storage methods providing revision support, RevisionableStorageInterface
was added. When defining a new entity type needing revision support be sure to set a storage handler implementing this interface.
Two of its methods are also defined by EntityStorageInterface
:
RevisionableStorageInterface::loadRevision()
RevisionableStorageInterface::deleteRevision()
The corresponding methods on EntityStorageInterface
could not be removed but should be considered deprecated. Entity storage classes not implementing ContentEntityStorageInterface
and supporting revisions should always implement RevisionableStorageInterface
, rather than relying on EntityStorageInterface
alone. Those methods will actually be deprecated in the last Drupal 8 minor release and will not be part of Drupal 9.
The new \Drupal\Core\Entity\RevisionableStorageInterface
interface contains the following methods:
loadRevision()
loadMultipleRevisions()
deleteRevision()
getLatestRevisionId()
Note that additional methods might be added to this interface before Drupal 8.5.0.
The new \Drupal\Core\Entity\TranslatableRevisionableStorageInterface
interface contains the following methods:
getLatestTranslationAffectingRevisionId()
On top of that, the following methods were added:
RevisionableInterface::isLatestRevision()
TranslatableRevisionableInterface::isLatestTranslationAffectingRevision