Skip to content
Snippets Groups Projects
Verified Commit d7a164eb authored by Dave Long's avatar Dave Long
Browse files

Issue #2980374 by joachim, ranjith_kumar_k_u, msankhala: Add an API docs topic...

Issue #2980374 by joachim, ranjith_kumar_k_u, msankhala: Add an API docs topic to cover entity characteristics in general and how they work

(cherry picked from commit 822dad38)
parent 72881152
Branches
Tags
12 merge requests!8394[warning] array_flip(): Can only flip STRING and INTEGER values, when saving a non-revisionable custom content entity,!7780issue 3443822: fix for 'No route found for the specified format html. Supported formats: json, xml.',!5013Issue #3071143: Table Render Array Example Is Incorrect,!4848Issue #1566662: Update module should send notifications on Thursdays,!4792Issue #2230689: Remove redundant "Italic" style,!4220Issue #3368223: Link field > Access to internal links is not checked on display.,!3884Issue #3356842,!3812Draft: Issue #3339373 by alexpott, andypost, mondrake:...,!3686Issue #3219967 against 9.5.x,!2205Quote all names in the regions section.,!1459Issue #3087632: menu_name max length is too long,!866Issue #2845319: The highlighting of the 'Home' menu-link does not respect query strings and fragment identifiers
......@@ -13,6 +13,8 @@
* editing.
*
* @see \Drupal\Core\Entity\Plugin\Validation\Constraint\EntityChangedConstraint
*
* @ingroup entity_type_characteristics
*/
interface EntityChangedInterface extends EntityInterface {
......
......@@ -4,6 +4,8 @@
/**
* Provides an interface for access to an entity's published state.
*
* @ingroup entity_type_characteristics
*/
interface EntityPublishedInterface extends EntityInterface {
......
......@@ -6,6 +6,8 @@
/**
* Defines methods for an entity that supports revision logging and ownership.
*
* @ingroup entity_type_characteristics
*/
interface RevisionLogInterface extends RevisionableInterface {
......
......@@ -19,6 +19,8 @@
* @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
*
* @ingroup entity_type_characteristics
*/
interface RevisionableInterface extends EntityInterface {
......
......@@ -6,6 +6,8 @@
/**
* Provides methods for an entity to support translation.
*
* @ingroup entity_type_characteristics
*/
interface TranslatableInterface extends TranslatableDataInterface, EntityInterface {
......
......@@ -122,6 +122,12 @@
* @see \Drupal\Core\Entity\TranslatableRevisionableInterface
* @see \Drupal\Core\Entity\TranslatableRevisionableStorageInterface
*
* @section characteristics Entity characteristics
*
* In addition to entity interfaces for revisionable and translatable
* interfaces, there are interfaces for other kinds of entity functionality.
* @see entity_characteristics
*
* @section create Create operations
* To create an entity:
* @code
......@@ -357,7 +363,10 @@
* as short as possible, and may not exceed 32 characters.
* - Define an interface for your entity's get/set methods, usually extending
* either \Drupal\Core\Config\Entity\ConfigEntityInterface or
* \Drupal\Core\Entity\ContentEntityInterface.
* \Drupal\Core\Entity\ContentEntityInterface. Other interfaces that add
* functionality are also available: see the
* @link entity_characteristics Entity characteristics topic @endlink
* for more information.
* - Define a class for your entity, implementing your interface and extending
* either \Drupal\Core\Config\Entity\ConfigEntityBase or
* \Drupal\Core\Entity\ContentEntityBase, with annotation for
......@@ -640,6 +649,31 @@
* @}
*/
/**
* @defgroup entity_type_characteristics Entity type characteristics
* @{
* Describes how to enhance entity types with additional functionality.
*
* When @link entity_api defining an entity type @endlink, 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\EntityInterface::baseFieldsDefinition() 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.
*
* @}
*/
/**
* @addtogroup hooks
* @{
......
......@@ -9,6 +9,8 @@
* owners in Unix file system access. This may or may not be the entity's
* original author. The owner may also have less permissions than other users,
* such as administrators.
*
* @ingroup entity_type_characteristics
*/
interface EntityOwnerInterface {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment