By damiankloip on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Introduced in version:
dev
Issue links:
Description:
Previously, all entity types used the @EntityType annotation and EntityType object (to get entity type definition). Now ConfigEntityType and ContentEntityType annotations and entity type objects have been added to provide better default values and more specific/descriptive annotations.
ConfigEntityStorage is added as the default storage for entity types that use @ConfigEntityType, so is no longer needed in the annotation unless it is being overridden. Similar for @ContentEntityType, ContentEntityDatabaseStorage is the default storage implementation then.
Use it like this:
/**
* Defines a Block configuration entity class.
*
* @ConfigEntityType(
* id = "block",
* label = @Translation("Block"),
* controllers = {
* "access" = "Drupal\block\BlockAccessControlHandler",
* "view_builder" = "Drupal\block\BlockViewBuilder",
* ...
* )
*/
Impacts:
Module developers