logo

Palette - Make it Colorful🎨

Palette - Visual Page Builder, no design degree required.

Live Demo Download Palette

Scroll
12/04/2025, by Ivan
  • Drupal 7 - Entities were generic stdClass objects.
  • Drupal 8 - Entities are now strongly typed objects, with each entity type defining the class used for its instances.

Requirements
Entity classes must reside in the Entity namespace of the module that provides the entity type, e.g., \Drupal\[module_name]\Entity. This means the PHP files for Entity classes can be found in the module's src/Entity directory.

12/04/2025, by Ivan

Audience

This documentation is primarily intended for developers experienced in object-oriented PHP, Drupal 6 or Drupal 7, and for those looking to explore the principles of Drupal 8.

The guide to creating a content entity type in Drupal 8 contains a full list of available options.

Building a Bundle-less Content Type in Drupal 8

In this case, we are creating a Drupal 8 content entity that does not have any bundles.

12/04/2025, by Ivan

Sometimes, when extracting a content type from a custom module, you may want to include fields associated with that content type. Automatically creating fields allows you to remove and reinstall on multiple sites without leaving behind unnecessary fields and ensures you don’t forget to add them. There are two ways to add these fields to your codebase, which we’ll cover here.

12/04/2025, by Ivan

Sometimes, when extracting a content type from a custom module, you may want to include fields associated with that content type. Automatically creating fields allows you to remove and reinstall on multiple sites without leaving behind unnecessary fields and ensures you don’t forget to add them. There are two ways to add these fields to your codebase, which we’ll cover here.