interface EntityChangedInterface
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Entity/EntityChangedInterface.php \Drupal\Core\Entity\EntityChangedInterface
- 10 core/lib/Drupal/Core/Entity/EntityChangedInterface.php \Drupal\Core\Entity\EntityChangedInterface
- 8.9.x core/lib/Drupal/Core/Entity/EntityChangedInterface.php \Drupal\Core\Entity\EntityChangedInterface
Defines an interface for entity change timestamp tracking.
This data may be useful for more precise cache invalidation (especially on the client side) and concurrent editing locking.
The entity system automatically adds in the 'EntityChanged' constraint for entity types implementing this interface in order to disallow concurrent editing.
Hierarchy
- interface \Drupal\Core\Access\AccessibleInterface; interface \Drupal\Core\Cache\CacheableDependencyInterface; interface \Drupal\Core\Cache\RefinableCacheableDependencyInterface extends \Drupal\Core\Cache\CacheableDependencyInterface
- interface \Drupal\Core\Entity\EntityInterface extends \Drupal\Core\Access\AccessibleInterface, \Drupal\Core\Cache\CacheableDependencyInterface, \Drupal\Core\Cache\RefinableCacheableDependencyInterface
- interface \Drupal\Core\Entity\EntityChangedInterface extends \Drupal\Core\Entity\EntityInterface
- interface \Drupal\Core\Entity\EntityInterface extends \Drupal\Core\Access\AccessibleInterface, \Drupal\Core\Cache\CacheableDependencyInterface, \Drupal\Core\Cache\RefinableCacheableDependencyInterface
Expanded class hierarchy of EntityChangedInterface
All classes that implement EntityChangedInterface
See also
\Drupal\Core\Entity\Plugin\Validation\Constraint\EntityChangedConstraint
Related topics
20 files declare their use of EntityChangedInterface
- BlockContentInterface.php in core/
modules/ block_content/ src/ BlockContentInterface.php - CommentInterface.php in core/
modules/ comment/ src/ CommentInterface.php - CommentStatistics.php in core/
modules/ comment/ src/ CommentStatistics.php - ContentTranslationHandler.php in core/
modules/ content_translation/ src/ ContentTranslationHandler.php - ContentTranslationUITestBase.php in core/
modules/ content_translation/ tests/ src/ Functional/ ContentTranslationUITestBase.php
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityChangedInterface.php, line 19
Namespace
Drupal\Core\EntityView source
interface EntityChangedInterface extends EntityInterface {
/**
* Gets the timestamp of the last entity change for the current translation.
*
* @return int
* The timestamp of the last entity save operation.
*/
public function getChangedTime();
/**
* Sets the timestamp of the last entity change for the current translation.
*
* @param int $timestamp
* The timestamp of the last entity save operation.
*
* @return $this
*/
public function setChangedTime($timestamp);
/**
* Gets the timestamp of the last entity change across all translations.
*
* This method will return the highest timestamp across all translations. To
* check that no translation is older than in another version of the entity
* (e.g. to avoid overwriting newer translations with old data), compare each
* translation to the other version individually.
*
* @return int
* The timestamp of the last entity save operation across all
* translations.
*/
public function getChangedTimeAcrossTranslations();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.