3 namespace Drupal\Core\Entity;
5 use Drupal\Core\TypedData\TranslatableInterface;
8 * Defines a common interface for all content entity objects.
10 * Content entities use fields for all their entity properties and are
11 * translatable and revisionable, while translations and revisions can be
12 * enabled per entity type. It's best practice to always implement
13 * ContentEntityInterface for content-like entities that should be stored in
14 * some database, and enable/disable revisions and translations as desired.
16 * When implementing this interface which extends Traversable, make sure to list
17 * IteratorAggregate or Iterator before this interface in the implements clause.
19 * @see \Drupal\Core\Entity\ContentEntityBase
23 interface ContentEntityInterface extends \Traversable, FieldableEntityInterface, RevisionableInterface, TranslatableInterface {
26 * Determines if the current translation of the entity has unsaved changes.
29 * TRUE if the current translation of the entity has changes.
31 public function hasTranslationChanges();
34 * Marks the current revision translation as affected.
36 * @param bool|null $affected
37 * The flag value. A NULL value can be specified to reset the current value
38 * and make sure a new value will be computed by the system.
42 public function setRevisionTranslationAffected($affected);
45 * Checks whether the current translation is affected by the current revision.
48 * TRUE if the entity object is affected by the current revision, FALSE
51 public function isRevisionTranslationAffected();
54 * Gets the loaded Revision ID of the entity.
57 * The loaded Revision identifier of the entity, or NULL if the entity
58 * does not have a revision identifier.
60 public function getLoadedRevisionId();
63 * Updates the loaded Revision ID with the revision ID.
65 * This method should not be used, it could unintentionally cause the original
66 * revision ID property value to be lost.
72 public function updateLoadedRevisionId();