Content entities provide base field definitions and configurable fields through the Field module. There is also support for revisions and translations with content entities. Display modes, both form and view, are available for content entities to control how the fields are edited and displayed. When an entity does not specify bundles, there is automatically one bundle instance with the same name as the entity.
In this recipe, we will create a custom content entity that does not specify a bundle. We will create a Message
entity that can serve as a content entity for generic messages.
You will need a custom module to place code into to implement a configuration entity type. Create an src
directory for your classes. Refer to the Creating a module recipe of Chapter 4, Extending Drupal, for information on creating a custom module.
Do not use a module which is currently installed, otherwise Drupal will not install your new entity type.