Unverified Commit b263f5c4 authored by alexpott's avatar alexpott

Issue #2822611 by Mile23, Wim Leers, alexpott, Berdir, catch, dawehner, xjm,...

Issue #2822611 by Mile23, Wim Leers, alexpott, Berdir, catch, dawehner, xjm, tstoeckler, borisson_: Document why UserInterface + FileInterface + MenuLinkContentInterface + … extend \Drupal\Core\Entity\ContentEntityInterface
parent a02e2ea0
......@@ -5,16 +5,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
*/
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment