You are here

interface EntityChangedInterface in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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

Expanded class hierarchy of EntityChangedInterface

All classes that implement EntityChangedInterface

See also

Drupal\Core\Entity\Plugin\Validation\Constraint\EntityChangedConstraint

12 files declare their use of EntityChangedInterface
BlockContentInterface.php in core/modules/block_content/src/BlockContentInterface.php
Contains \Drupal\block_content\BlockContentInterface.
CommentInterface.php in core/modules/comment/src/CommentInterface.php
Contains \Drupal\comment\CommentInterface.
CommentStatistics.php in core/modules/comment/src/CommentStatistics.php
Contains \Drupal\comment\CommentStatistics.
EntityTestConstraints.php in core/modules/system/tests/modules/entity_test/src/Entity/EntityTestConstraints.php
Contains \Drupal\entity_test\Entity\EntityTestConstraints.
EntityTestMulChanged.php in core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulChanged.php
Contains \Drupal\entity_test\Entity\EntityTestMulChanged.

... See full list

File

core/lib/Drupal/Core/Entity/EntityChangedInterface.php, line 22
Contains \Drupal\Core\Entity\EntityChangedInterface.

Namespace

Drupal\Core\Entity
View source
interface EntityChangedInterface {

  /**
   * 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.
   *
   * @return int
   *   The timestamp of the last entity save operation across all
   *   translations.
   */
  public function getChangedTimeAcrossTranslations();

}

Members

Namesort descending Modifiers Type Description Overrides
EntityChangedInterface::getChangedTime public function Gets the timestamp of the last entity change for the current translation.
EntityChangedInterface::getChangedTimeAcrossTranslations public function Gets the timestamp of the last entity change across all translations.
EntityChangedInterface::setChangedTime public function Sets the timestamp of the last entity change for the current translation.