Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

Previously, each entity type class would extend EntityInterface, ContentEntityInterface, or ConfigEntityInterface, and EntityInterface or the class name (e.g. Node) was used to type-hint parameters.

Now each entity type class should implement its own interface, and when a method or function argument must be that entity type, type-hint with the specific interface.

For example, hook_entity_delete() still works on any entity type, so a custom module would use:

use Drupal\Core\Entity\EntityInterface;

function mymodule_entity_delete(EntityInterface $entity) {
}

But a node-specific hook like hook_node_prepare() would instead specify that it expects a node:

use Drupal\node\NodeInterface;

function mymodule_node_prepare(NodeInterface $node) {
}

In addition, any public methods added to a custom entity type must be on the interface as well.

For example, Drupal\menu_link\Plugin\Core\Entity\MenuLink has a getRoute() method, so it is documented and specified on Drupal\menu_link\MenuLinkInterface.

Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done