TranslatableRevisionableInterface.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. namespace Drupal\Core\Entity;
  3. /**
  4. * Provides methods for an entity to support revision translation.
  5. */
  6. interface TranslatableRevisionableInterface extends TranslatableInterface, RevisionableInterface {
  7. /**
  8. * Checks whether this is the latest revision affecting this translation.
  9. *
  10. * @return bool
  11. * TRUE if this revision is the latest one affecting the active translation,
  12. * FALSE otherwise.
  13. */
  14. public function isLatestTranslationAffectedRevision();
  15. /**
  16. * Marks the current revision translation as affected.
  17. *
  18. * Setting the revision translation affected flag through the setter or
  19. * through the field directly will always enforce it, which will be used by
  20. * the entity storage to determine if the flag should be recomputed or the set
  21. * value should be used instead.
  22. * @see \Drupal\Core\Entity\ContentEntityStorageBase::populateAffectedRevisionTranslations()
  23. *
  24. * @param bool|null $affected
  25. * The flag value. A NULL value can be specified to reset the current value
  26. * and make sure a new value will be computed by the system.
  27. *
  28. * @return $this
  29. */
  30. public function setRevisionTranslationAffected($affected);
  31. /**
  32. * Checks whether the current translation is affected by the current revision.
  33. *
  34. * @return bool
  35. * TRUE if the entity object is affected by the current revision, FALSE
  36. * otherwise.
  37. */
  38. public function isRevisionTranslationAffected();
  39. /**
  40. * Checks if the revision translation affected flag value has been enforced.
  41. *
  42. * @return bool
  43. * TRUE if revision translation affected flag is enforced, FALSE otherwise.
  44. *
  45. * @internal
  46. */
  47. public function isRevisionTranslationAffectedEnforced();
  48. /**
  49. * Enforces the revision translation affected flag value.
  50. *
  51. * Note that this method call will not have any influence on the storage if
  52. * the value of the revision translation affected flag is NULL which is used
  53. * as an indication for the storage to recompute the flag.
  54. * @see \Drupal\Core\Entity\ContentEntityInterface::setRevisionTranslationAffected()
  55. *
  56. * @param bool $enforced
  57. * If TRUE, the value of the revision translation affected flag will be
  58. * enforced so that on entity save the entity storage will not recompute it.
  59. * Otherwise the storage will recompute it.
  60. *
  61. * @return $this
  62. *
  63. * @internal
  64. */
  65. public function setRevisionTranslationAffectedEnforced($enforced);
  66. /**
  67. * Checks if untranslatable fields should affect only the default translation.
  68. *
  69. * @return bool
  70. * TRUE if untranslatable fields should affect only the default translation,
  71. * FALSE otherwise.
  72. */
  73. public function isDefaultTranslationAffectedOnly();
  74. }