Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Berdir on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
Using a configuration entity to manage bundles of a fieldable content entity is a common pattern in Drupal 8. A new bundle_of
property has been added, which defines this relationship.
Currently, the only thing that relies on that definition is field_ui.module
, which uses it to add the following operations to the configuration entity list: Manage fields; Manage form display and Manage display.
The following entity types use bundle_of:
- node_type for node
- taxonomy_vocabulary for taxonomy_term
- custom_block_type for custom_block
- contact_category for contact_message
Example:
/**
* Defines the Node type configuration entity.
*
* @EntityType(
* id = "node_type",
* label = @Translation("Content type"),
* module = "node",
* ...
* config_prefix = "type",
* bundle_of = "node",
* ...
* )
*/
class NodeType extends ConfigEntityBase implements NodeTypeInterface {
Impacts:
Module developers