diff core/lib/Drupal/Core/Entity/EntityChangedInterface.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 7a779792577d
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/lib/Drupal/Core/Entity/EntityChangedInterface.php	Wed Nov 29 16:09:58 2017 +0000
@@ -0,0 +1,46 @@
+<?php
+
+namespace Drupal\Core\Entity;
+
+/**
+ * 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.
+ *
+ * @see Drupal\Core\Entity\Plugin\Validation\Constraint\EntityChangedConstraint
+ */
+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();
+
+}