diff --git a/core/lib/Drupal/Core/Entity/EntityType.php b/core/lib/Drupal/Core/Entity/EntityType.php index 110fcee..a6b11ce 100644 --- a/core/lib/Drupal/Core/Entity/EntityType.php +++ b/core/lib/Drupal/Core/Entity/EntityType.php @@ -187,6 +187,11 @@ class EntityType implements EntityTypeInterface { protected $label = ''; /** + * A description of the entity type. + */ + protected $description = ''; + + /** * A callable that can be used to provide the entity URI. * * @var callable|null @@ -641,6 +646,13 @@ public function getLabel() { /** * {@inheritdoc} */ + public function getDescription() { + return $this->description; + } + + /** + * {@inheritdoc} + */ public function getLowercaseLabel() { return Unicode::strtolower($this->getLabel()); } diff --git a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php index e655df7..4c65696 100644 --- a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php @@ -609,6 +609,14 @@ public function getDataTable(); public function getLabel(); /** + * Returns the entity type's description + * + * @return string + * The entity type's description. + */ + public function getDescription(); + + /** * Returns the lowercase form of the human-readable entity type name. * * @return string diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php index d70ec7d..b1c4721 100644 --- a/core/modules/aggregator/src/Entity/Feed.php +++ b/core/modules/aggregator/src/Entity/Feed.php @@ -20,6 +20,7 @@ * @ContentEntityType( * id = "aggregator_feed", * label = @Translation("Aggregator feed"), + * description = @Translation("Feeds provide syndicated content (RSS, RDF, and Atom feeds.)"), * controllers = { * "storage" = "Drupal\aggregator\FeedStorage", * "view_builder" = "Drupal\aggregator\FeedViewBuilder", diff --git a/core/modules/aggregator/src/Entity/Item.php b/core/modules/aggregator/src/Entity/Item.php index f41080a5..b7f179f 100644 --- a/core/modules/aggregator/src/Entity/Item.php +++ b/core/modules/aggregator/src/Entity/Item.php @@ -21,6 +21,7 @@ * @ContentEntityType( * id = "aggregator_item", * label = @Translation("Aggregator feed item"), + * description = @Translation("An item from a syndicated feed."), * controllers = { * "storage" = "Drupal\aggregator\ItemStorage", * "view_builder" = "Drupal\aggregator\ItemViewBuilder", diff --git a/core/modules/block_content/src/Entity/BlockContent.php b/core/modules/block_content/src/Entity/BlockContent.php index b004261..6da218b 100644 --- a/core/modules/block_content/src/Entity/BlockContent.php +++ b/core/modules/block_content/src/Entity/BlockContent.php @@ -19,6 +19,7 @@ * @ContentEntityType( * id = "block_content", * label = @Translation("Custom Block"), + * description = @Translation("Blocks are custom pieces of content."), * bundle_label = @Translation("Custom Block type"), * controllers = { * "storage" = "Drupal\block_content\BlockContentStorage", diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php index edde6c3..76a8bab 100644 --- a/core/modules/comment/src/Entity/Comment.php +++ b/core/modules/comment/src/Entity/Comment.php @@ -22,6 +22,7 @@ * @ContentEntityType( * id = "comment", * label = @Translation("Comment"), + * description = @Translation("Comments are responses to node content."), * bundle_label = @Translation("Content type"), * controllers = { * "storage" = "Drupal\comment\CommentStorage", diff --git a/core/modules/contact/src/Entity/Message.php b/core/modules/contact/src/Entity/Message.php index 9cf50bc..be9ef84 100644 --- a/core/modules/contact/src/Entity/Message.php +++ b/core/modules/contact/src/Entity/Message.php @@ -18,6 +18,7 @@ * @ContentEntityType( * id = "contact_message", * label = @Translation("Contact message"), + * description = @Translation("Contact messages are contact form submissions."), * controllers = { * "storage" = "Drupal\Core\Entity\ContentEntityNullStorage", * "view_builder" = "Drupal\contact\MessageViewBuilder", diff --git a/core/modules/file/src/Entity/File.php b/core/modules/file/src/Entity/File.php index 48745d8..3fc9ad1 100644 --- a/core/modules/file/src/Entity/File.php +++ b/core/modules/file/src/Entity/File.php @@ -21,6 +21,7 @@ * @ContentEntityType( * id = "file", * label = @Translation("File"), + * description = @Translation("Files that are managed within Drupal."), * controllers = { * "storage" = "Drupal\file\FileStorage", * "access" = "Drupal\file\FileAccessControlHandler", diff --git a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php index 11f1d12..0915290 100644 --- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -20,6 +20,7 @@ * @ContentEntityType( * id = "menu_link_content", * label = @Translation("Custom menu link"), + * description = @Translation("Custom menu links that belong to a menu."), * controllers = { * "storage" = "Drupal\Core\Entity\ContentEntityDatabaseStorage", * "access" = "Drupal\menu_link_content\MenuLinkContentAccessControlHandler", diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php index c57e3af..9435bb2 100644 --- a/core/modules/node/src/Entity/Node.php +++ b/core/modules/node/src/Entity/Node.php @@ -23,6 +23,7 @@ * id = "node", * label = @Translation("Content"), * bundle_label = @Translation("Content type"), + * description = @Translation("Nodes are individual pieces of content."), * controllers = { * "storage" = "Drupal\node\NodeStorage", * "view_builder" = "Drupal\node\NodeViewBuilder", diff --git a/core/modules/shortcut/src/Entity/Shortcut.php b/core/modules/shortcut/src/Entity/Shortcut.php index 706ef0a..1fcfb8d 100644 --- a/core/modules/shortcut/src/Entity/Shortcut.php +++ b/core/modules/shortcut/src/Entity/Shortcut.php @@ -21,6 +21,7 @@ * @ContentEntityType( * id = "shortcut", * label = @Translation("Shortcut link"), + * description = @Translation("Shortcut links provide quick administrative access."), * controllers = { * "access" = "Drupal\shortcut\ShortcutAccessControlHandler", * "form" = { diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php index 2470c8c..68107e5 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php @@ -20,6 +20,7 @@ * @ContentEntityType( * id = "entity_test", * label = @Translation("Test entity"), + * description = @Translation("Test entities are the base for other test entities."), * controllers = { * "list_builder" = "Drupal\entity_test\EntityTestListBuilder", * "view_builder" = "Drupal\entity_test\EntityTestViewBuilder", diff --git a/core/modules/taxonomy/src/Entity/Term.php b/core/modules/taxonomy/src/Entity/Term.php index e50e3a0..1c89890 100644 --- a/core/modules/taxonomy/src/Entity/Term.php +++ b/core/modules/taxonomy/src/Entity/Term.php @@ -19,6 +19,7 @@ * @ContentEntityType( * id = "taxonomy_term", * label = @Translation("Taxonomy term"), + * description = @Translation("Taxonomy terms allow categorization of content."), * bundle_label = @Translation("Vocabulary"), * controllers = { * "storage" = "Drupal\taxonomy\TermStorage", diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php index ffc9dfc..a39d5ab 100644 --- a/core/modules/user/src/Entity/User.php +++ b/core/modules/user/src/Entity/User.php @@ -23,6 +23,7 @@ * @ContentEntityType( * id = "user", * label = @Translation("User"), + * description = @Translation("Users are accounts in the Drupal site."), * controllers = { * "storage" = "Drupal\user\UserStorage", * "access" = "Drupal\user\UserAccessControlHandler",