X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FRevisionableInterface.php;h=ee53e398f054a9952b215116454d3b825892ccfa;hb=refs%2Fheads%2Fd864;hp=0fc6db2fec9359a310bc6bf3d9bff5da58a42174;hpb=af6d1fb995500ae68849458ee10d66abbdcfb252;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Entity/RevisionableInterface.php b/web/core/lib/Drupal/Core/Entity/RevisionableInterface.php index 0fc6db2fe..ee53e398f 100644 --- a/web/core/lib/Drupal/Core/Entity/RevisionableInterface.php +++ b/web/core/lib/Drupal/Core/Entity/RevisionableInterface.php @@ -4,6 +4,21 @@ namespace Drupal\Core\Entity; /** * Provides methods for an entity to support revisions. + * + * Classes implementing this interface do not necessarily support revisions. + * + * To detect whether an entity type supports revisions, call + * EntityTypeInterface::isRevisionable(). + * + * Many entity interfaces are composed of numerous other interfaces such as this + * one, which allow implementations to pick and choose which features to. + * support through stub implementations of various interface methods. This means + * that even if an entity class implements RevisionableInterface, it might only + * have a stub implementation and not a functional one. + * + * @see \Drupal\Core\Entity\EntityTypeInterface::isRevisionable() + * @see https://www.drupal.org/docs/8/api/entity-api/structure-of-an-entity-annotation + * @see https://www.drupal.org/docs/8/api/entity-api/making-an-entity-revisionable */ interface RevisionableInterface { @@ -39,6 +54,27 @@ interface RevisionableInterface { */ public function getRevisionId(); + /** + * Gets the loaded Revision ID of the entity. + * + * @return int + * The loaded Revision identifier of the entity, or NULL if the entity + * does not have a revision identifier. + */ + public function getLoadedRevisionId(); + + /** + * Updates the loaded Revision ID with the revision ID. + * + * This method should not be used, it could unintentionally cause the original + * revision ID property value to be lost. + * + * @internal + * + * @return $this + */ + public function updateLoadedRevisionId(); + /** * Checks if this entity is the default revision. *