Chapter 10. The Entity API

In this chapter, we will explore the Entity API to create custom entities and see how they are handled:

  • Creating a configuration entity type
  • Creating a content entity type
  • Creating a bundle for a content entity type
  • Implementing custom access control for an entity
  • Providing a custom storage handler
  • Creating a route provider

Introduction

In Drupal, entities are a representation of data that have a specific structure. There are specific entity types, which have different bundles and fields attached to those bundles. Bundles are implementations of entities that can have fields attached to themselves. In terms of programming, you can consider an entity that supports bundles an abstract class and each bundle a class that extends ...

Get Drupal 8: Enterprise Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.