What will you learn
- Overview of Entity API components and terminology
- Creating, reading, updating, and deleting entity data
- Practical examples of creating custom entities
- Using the EntityQuery service to find entities
- Overview of Field API components: field types, widgets, and formatters
- Working with field data in code
- Creating and managing custom fields
- Practical examples and use cases for field widgets and formatters
- Defining and using configuration data types
- Adding properties to a configuration entity
Overview
Drupal's Entity API offers a handy framework for defining, managing, and interacting with data objects (entities) in a consistent and extensible manner across the system.
Drupal's Field API provides a powerful system for defining, managing, and storing various types of structured data fields on entities, allowing for flexible content modeling and customization.
Configuration entities in Drupal are objects that store and manage configuration settings, allowing for exportable, deployable, and version-controlled configuration data within a Drupal site.
Drupal developer learning resources
Entities
In this course you’ll learn the foundational concepts and terminology of the Entity API, including the differences between configuration and content entities, and how to create, read, update, and delete entity data. We’ll cover practical examples of creating custom entities, implementing validation logic, and using hooks to interact with entity lifecycle operations. You will also learn how to use the EntityQuery service to find and manipulate subsets of data, and how to implement access control for entities. Additionally, the course will delve into the use of annotations and handlers, and how to leverage the Entity API for better performance and extensibility in your Drupal modules.
Fields
In this course you’ll learn the foundational concepts and components of the Field API, including how to define and manage field instances, field types, form widgets, and display formatters. The course will cover how to use the Field API to create custom fields, interact with field data programmatically, and alter field behavior using hooks. Additionally, you will explore the differences between base fields and user-defined fields, and how to leverage the Field API to build flexible and extensible data models in Drupal.
Configuration
Have you ever updated the site name, configured image styles, or created a role for content editors? These are all features of Drupal's Configuration API. The Configuration API provides a consistent way for modules to store, retrieve, update, and package configuration for deployment across environments. In this course, you will learn how to create, retrieve, and update different types of configuration data in a module, including learning how to create module settings forms and define configuration entity types.