Change record status: 
Introduced in branch: 

With the introduction of configuration entities, EntityInterface now has two child interfaces:

  • ContentEntityInterface
  • ConfigEntityInterface

Content entity classes should extend the Entity base class, and their entity type interface should implement ContentEntityInterface, for example:

namespace Drupal\comment\Plugin\Core\Entity;

use Drupal\comment\CommentInterface;
use Drupal\Core\Entity\Entity;

class Comment extends Entity implements CommentInterface {}
namespace Drupal\comment;

use Drupal\Core\Entity\ContentEntityInterface;

interface CommentInterface extends ContentEntityInterface {}

ContentEntityInterface does not currently define any methods on its own, but it can be extended to provide content-specific functionality.

The following core entity type interfaces extend ContentEntityInterface:

  • FeedInterface (aggregator)
  • ItemInterface (aggregator)
  • CustomBlockInterface
  • CommentInterface
  • FileInterface
  • MenuLinkInterface
  • NodeInterface
  • TermInterface

Since user accounts are not content, User extends entity without implementing the ContentEntityInterface:

namespace Drupal\user\Plugin\Core\Entity;

use Drupal\Core\Entity\Entity;
use Drupal\user\UserInterface;

class User extends Entity implements UserInterface {}
namespace Drupal\user;

use Drupal\Core\Entity\EntityInterface;

interface UserInterface extends EntityInterface {}

Note that configuration entity classes implement ConfigEntityInterface instead of ContentEntityInterface:

namespace Drupal\Core\Config\Entity;

use Drupal\Core\Entity\Entity;

abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface {}

When defining a new entity class, decide whether the entity should be stored as content (like nodes), configuration (like node types), or neither (like users).

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 updates done