Entity type characteristics
Same name in other branches
- 10 core/lib/Drupal/Core/Entity/entity.api.php \entity_type_characteristics
- 11.x core/lib/Drupal/Core/Entity/entity.api.php \entity_type_characteristics
Describes how to enhance entity types with additional functionality.
When defining an entity type, the functionality of the entities can be enhanced with additional characteristics. Examples include entities that have a published/unpublished status, or a timestamp that gives the time they were last modified.
These characteristics are provided by an interface, which the entity's own interface should inherit from, in addition to \Drupal\Core\Config\Entity\ConfigEntityInterface or \Drupal\Core\Entity\ContentEntityInterface.
Some characteristics also provide a trait for the entity class. This has implementations of the interface's methods, and may also have a helper method for \Drupal\Core\Entity\FieldableEntityInterface::baseFieldDefinitions() which defines base fields that the trait expects to store data. Furthermore, trait methods may expect certain entity keys to be set: see the documentation for each trait for details.
File
-
core/
lib/ Drupal/ Core/ Entity/ entity.api.php, line 652
Interfaces
Title Sort descending | File name | Summary |
---|---|---|
EntityChangedInterface | core/ |
Defines an interface for entity change timestamp tracking. |
EntityOwnerInterface | core/ |
Defines a common interface for entities that have an owner. |
EntityPublishedInterface | core/ |
Provides an interface for access to an entity's published state. |
RevisionableInterface | core/ |
Provides methods for an entity to support revisions. |
RevisionLogInterface | core/ |
Defines methods for an entity that supports revision logging and ownership. |
TranslatableInterface | core/ |
Provides methods for an entity to support translation. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.