3 namespace Drupal\Core\Entity;
6 * A storage that supports translatable and revisionable entity types.
8 interface TranslatableRevisionableStorageInterface extends TranslatableStorageInterface, RevisionableStorageInterface {
11 * Creates a new revision starting off from the specified entity object.
13 * When dealing with a translatable entity, this will merge the default
14 * revision with the active translation of the passed entity.
16 * @param \Drupal\Core\Entity\EntityInterface|\Drupal\Core\Entity\RevisionableInterface $entity
17 * The revisionable entity object being modified.
18 * @param bool $default
19 * (optional) Whether the new revision should be marked as default. Defaults
21 * @param bool|null $keep_untranslatable_fields
22 * (optional) Whether untranslatable field values should be kept or copied
23 * from the default revision when generating a merged revision. Defaults to
24 * TRUE if the provided entity is the default translation and untranslatable
25 * fields should only affect the default translation, FALSE otherwise.
27 * @return \Drupal\Core\Entity\EntityInterface|\Drupal\Core\Entity\RevisionableInterface
28 * A new translatable entity revision object.
30 public function createRevision(RevisionableInterface $entity, $default = TRUE, $keep_untranslatable_fields = NULL);
33 * Returns the latest revision affecting the specified translation.
35 * @param int|string $entity_id
36 * The entity identifier.
37 * @param string $langcode
38 * The language code of the translation.
40 * @return int|string|null
41 * A revision ID or NULL if no revision affecting the specified translation
44 public function getLatestTranslationAffectedRevisionId($entity_id, $langcode);