By dawehner on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.1.x
Issue links:
Description:
There are many improvements for defining entity types.
- When defining the base fields of an entity you no longer have to define ID, UUID, bundle, langcode as well as revision ID. They are autogenerated now in
ContentEntityBase::baseFieldDefinitions(). Just make sure you call the parent implementation. - In addition to generating edit-form and delete-form routes, DefaultHtmlRouteProvider and AdminHtmlRouteProvider now also generate add-page and add-form routes. Add the corresponding link templates and make sure the route provider is present to have them generated:
"handlers" = { "route_providers" = { "html" = "\Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider", }, }, links = { "add-page" = "/node/add", "add-form" = "/node/add/{node_type}", - Entities can provide additional information to revisions on top of just the revision ID:
- The time the revision got created
- The user which created the revision
- A message alongside the revision
In order to use it, either extend
\Drupal\Core\Entity\RevisionableContentEntityBaseor implement\Drupal\Core\Entity\RevisionLogInterface
and leverage the\Drupal\Core\Entity\RevisionLogEntityTrait
Impacts:
Module developers