Module Development

Entity API Implementation Basics for Drupal 8, 9, 10, and 11

Entities are the core data structures that provide the building blocks for nearly everything on a Drupal site. Whether an entity provides configuration or content, it plays a key role in how Drupal stores and manages data. Entities provide a consistent, developer-friendly, and Drupal-aware abstraction to data stored in the database.

In this tutorial, we will:

  • Explore how different entity types relate.
  • Compare configuration and content entities to understand the purpose and implementation of both.
  • Review how (at a high level) an entity type is defined.

By the end of this tutorial, you'll understand the relationship between configuration and content entities and be able to identify the parts of code that define a custom entity type.