Entity API

Drupal 8 Entity API documentation.

Introduction to Entity API in Drupal 8

Introduction to Entity API in Drupal 8

Entity types

Drupal 7 - entities were generic stdClass objects.

Working with the Entity API

Covers

Bundles

In Drupal 8+, bundles are a type of container for information that contain field or setting definitions. They are sometimes called as "sub

Configuration Entity

Configuration entities uses the new Drupal 8 entity API in order to keep configuration in the database.

Content Entity

This cheat sheet provides an overview of frequently used methods, classes and interfaces for content entities.

Create a custom content entity.

Audience

Creating a custom content type in Drupal 8

This page appears to be a duplicate of Include default configuration in your Drupal 8 module. It should be considered for deprecation.

Programming custom fields into your content type

Sometimes when you're pulling in a content type from a custom module, you'd also like to pull in fields specific to this content type.

Using the UI to export the code for your custom fields

Sometimes when you're pulling in a content type from a custom module, you'd also like to pull in fields specific to this content type.

Entity API implements Typed Data API

Major improvement

Access on entities (TBD)

Initial stub page, just to outline the different child-pages we need.

Defining and using Content Entity Field definitions

Content entities have to define all their fields explicitly by providing definitions on the entity class. The field definitions are based on

Entity Translation API

In Drupal 8 field language is no longer exposed in the public API, instead fields are attached to language-aware entity objects from which

Display Modes, View Modes, and Form Modes

Display modes

Entities: Drupal 8 [pre-delete]

FieldTypes, FieldWidgets and FieldFormatters

Overview

Upgrading Code Snippets Module to Drupal 8: Creating a Custom Field

Dynamic/Virtual field values using computed field property classes

Sometimes it is necessary to have "computed" properties in a field, alongside actual values that are stored in the database. A good example

Handlers

Handlers were previously known as Controllers. See Change Record.

Making an entity revisionable

Making an entity become revisionable is fairly simple, basically you just need to define the entity's revision table and mark the fields to

Structure of an Entity annotation

Entity types, both configuration and content entity are defined using annotation.

Creating a content entity type in Drupal 8

This page provides an example of how to create a content entity type, with administration management pages, for Drupal 8.

Making the content entity searchable

Stub page. Example code to follow

Guide maintainers