diff --git a/core/lib/Drupal/Core/Entity/ContentEntityInterface.php b/core/lib/Drupal/Core/Entity/ContentEntityInterface.php index d045152f6a..b684600168 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityInterface.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityInterface.php @@ -7,16 +7,19 @@ /** * Defines a common interface for all content entity objects. * - * Content entities use fields for all their entity properties and are - * translatable and revisionable, while translations and revisions can be - * enabled per entity type. It's best practice to always implement - * ContentEntityInterface for content-like entities that should be stored in - * some database, and enable/disable revisions and translations as desired. + * Content entities use fields for all their entity properties and can be + * translatable and revisionable. Translations and revisions can be + * enabled per entity type through annotation and using entity type hooks. + * + * It's best practice to always implement ContentEntityInterface for + * content-like entities that should be stored in some database, and + * enable/disable revisions and translations as desired. * * When implementing this interface which extends Traversable, make sure to list * IteratorAggregate or Iterator before this interface in the implements clause. * * @see \Drupal\Core\Entity\ContentEntityBase + * @see \Drupal\Core\Entity\EntityTypeInterface * * @ingroup entity_api */ diff --git a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php index c8a28b4358..f5f4d2f831 100644 --- a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php @@ -7,10 +7,19 @@ /** * Provides an interface for an entity type and its metadata. * - * Additional information can be provided by modules: hook_entity_type_build() can be - * implemented to define new properties, while hook_entity_type_alter() can be - * implemented to alter existing data and fill-in defaults. Module-specific - * properties should be documented in the hook implementations defining them. + * Entity type classes can provide docblock annotations. The entity type manager + * will use these annotations to populate the entity type object with + * properties. + * + * Additional properties can be defined by module implementations of + * hook_entity_type_build(). Existing data can be altered in implementations of + * hook_entity_type_alter(), which can also be used to fill in defaults. + * Module-specific properties should be documented in the hook implementations + * defining them. + * + * @see \Drupal\Core\Entity\EntityTypeManagerInterface + * @see hook_entity_type_build() + * @see hook_entity_type_alter() */ interface EntityTypeInterface extends PluginDefinitionInterface { diff --git a/core/lib/Drupal/Core/Entity/RevisionableInterface.php b/core/lib/Drupal/Core/Entity/RevisionableInterface.php index 14690e3c54..c52f355dd2 100644 --- a/core/lib/Drupal/Core/Entity/RevisionableInterface.php +++ b/core/lib/Drupal/Core/Entity/RevisionableInterface.php @@ -4,6 +4,21 @@ /** * Provides methods for an entity to support revisions. + * + * Classes implementing this interface do not necessarily support revisions. + * + * To detect whether an entity type supports revisions, call + * EntityTypeInterface::isRevisionable(). + * + * Many entity interfaces are composed of numerous other interfaces such as this + * one, which allow implementations to pick and choose which features to. + * support through stub implementations of various interface methods. This means + * that even if an entity class implements RevisionableInterface, it might only + * have a stub implementation and not a functional one. + * + * @see \Drupal\Core\Entity\EntityTypeInterface::isRevisionable() + * @see https://www.drupal.org/docs/8/api/entity-api/structure-of-an-entity-annotation + * @see https://www.drupal.org/docs/8/api/entity-api/making-an-entity-revisionable */ interface RevisionableInterface { diff --git a/core/lib/Drupal/Core/TypedData/TranslatableInterface.php b/core/lib/Drupal/Core/TypedData/TranslatableInterface.php index 5b57a8717f..b9ee530d8d 100644 --- a/core/lib/Drupal/Core/TypedData/TranslatableInterface.php +++ b/core/lib/Drupal/Core/TypedData/TranslatableInterface.php @@ -4,6 +4,21 @@ /** * Interface for translatable data. + * + * Classes implementing this interface do not necessarily support translations. + * + * To detect whether an entity type supports translation, call + * EntityTypeInterface::isTranslatable(). + * + * Many entity interfaces are composed of numerous other interfaces such as this + * one, which allow implementations to pick and choose which features to support + * through stub implementations of various interface methods. This means that + * even if an entity class implements TranslatableInterface, it might only have + * a stub implementation and not a functional one. + * + * @see \Drupal\Core\Entity\EntityTypeInterface::isTranslatable() + * @see https://www.drupal.org/docs/8/api/entity-api/structure-of-an-entity-annotation + * @see https://www.drupal.org/docs/8/api/entity-api/entity-translation-api */ interface TranslatableInterface {