3 namespace Drupal\Core\Entity;
6 * Defines an interface for entity change timestamp tracking.
8 * This data may be useful for more precise cache invalidation (especially
9 * on the client side) and concurrent editing locking.
11 * The entity system automatically adds in the 'EntityChanged' constraint for
12 * entity types implementing this interface in order to disallow concurrent
15 * @see Drupal\Core\Entity\Plugin\Validation\Constraint\EntityChangedConstraint
17 interface EntityChangedInterface {
20 * Gets the timestamp of the last entity change for the current translation.
23 * The timestamp of the last entity save operation.
25 public function getChangedTime();
28 * Sets the timestamp of the last entity change for the current translation.
30 * @param int $timestamp
31 * The timestamp of the last entity save operation.
35 public function setChangedTime($timestamp);
38 * Gets the timestamp of the last entity change across all translations.
40 * This method will return the highest timestamp across all translations. To
41 * check that no translation is older than in another version of the entity
42 * (e.g. to avoid overwriting newer translations with old data), compare each
43 * translation to the other version individually.
46 * The timestamp of the last entity save operation across all
49 public function getChangedTimeAcrossTranslations();