Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Gábor Hojtsy on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Introduced in version:
8.0
Issue links:
Description:
A new EntityChangedInterface has been added to be used by entities which have changed timestamp information to track / provide. The interface exposes the changed timestamp via the getChangedTime() method. Implement this interface and provide this method if your entity has changed timestamp tracking, eg:
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityChangedInterface;
interface YourContentEntityInterface extends ContentEntityInterface, EntityChangedInterface {
// ...
}
The EntityChangedInterface may be used in the future to facilitate edit overwrite protection on content entities as well as better caching.
Impacts:
Module developers