Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EntityChangedInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 /**
6  * Defines an interface for entity change timestamp tracking.
7  *
8  * This data may be useful for more precise cache invalidation (especially
9  * on the client side) and concurrent editing locking.
10  *
11  * The entity system automatically adds in the 'EntityChanged' constraint for
12  * entity types implementing this interface in order to disallow concurrent
13  * editing.
14  *
15  * @see Drupal\Core\Entity\Plugin\Validation\Constraint\EntityChangedConstraint
16  */
17 interface EntityChangedInterface {
18
19   /**
20    * Gets the timestamp of the last entity change for the current translation.
21    *
22    * @return int
23    *   The timestamp of the last entity save operation.
24    */
25   public function getChangedTime();
26
27   /**
28    * Sets the timestamp of the last entity change for the current translation.
29    *
30    * @param int $timestamp
31    *   The timestamp of the last entity save operation.
32    *
33    * @return $this
34    */
35   public function setChangedTime($timestamp);
36
37   /**
38    * Gets the timestamp of the last entity change across all translations.
39    *
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.
44    *
45    * @return int
46    *   The timestamp of the last entity save operation across all
47    *   translations.
48    */
49   public function getChangedTimeAcrossTranslations();
50
51 }