Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Entity API

225,819 sites Security covered Drupal 10–11 Entity ecosystem
View on drupal.org

This module provides a unified way to manage entities and their properties within Drupal. It simplifies the creation of new entity types and offers generic functionality for site builders, such as rendering entities in views and providing token support. For developers, it exposes API functions for entity operations and a system for defining entity property information and data wrappers.

This module extends the entity API of Drupal core in order to provide a unified way to deal with entities and their properties. Additionally, it provides an entity CRUD controller, which helps simplifying the creation of new entity types.

Requirements

  • Drupal 7.2 or later; suggested Drupal >= 7.15

Documentation

You can find documentation in the handbooks. Also check the README and the provided API docs in entity.api.php.

Overview

For site-builders

This is an API module, so it doesn't provide any end-user features. However, it provides some entity generic functionality to other modules that site-builders may leverage:

  • A Views display plugin and field to render or link to any entity (by view-mode)
  • A CTools content plugin to render any entity (by view-mode)
  • It ships with the Entity tokens module which makes sure there are tokens for most entity properties and fields, i.e. it provides token replacements for all entity properties (or fields) that have no tokens and are known to the entity module (read about the entity property info API below).

For developers

  • The module provides API functions allowing modules to create, save, delete, view or to determine access for any entity, i.e. entity_create(), entity_save(), entity_delete(), entity_view() and entity_access().
  • The entity API introduces a unique place for metadata about entity relationships and entity properties: hook_entity_property_info(). This information about entity properties contains the data type and callbacks for how to get and set the data of a property. Modules may rely on this information in order to support any entity property, e.g. Rules and the Search API build upon that.
  • Furthermore the module provides data wrappers that make use of the available information to provide a simple and unified access to entities and their properties. For usage examples have a look at the README or the provided tests.
  • Beside that, the module helps you defining a new entity type. For that, it provides an entity controller, which implements full CRUD functionality for your entities. Optionally, entities may be created based on classes derived from the provided Entity class.
  • The entity API cares about creating fieldable, optionally revisionable entities as well as exportable entities. Additionally it supports implementing bundle entities, i.e. bundle objects (like node types) for fieldable entities implemented as (exportable) entities, for which the appropriate field API callbacks get automatically invoked.
  • For entity types implemented based upon the provided CRUD API the API is providing additional module integration too, i.e. Rules events are provided for all CRUD-related hooks, some basic entity property information for hook_entity_property_info() is provided and exportable entities are automatically integrated with the Features module.
    These module integrations are implemented in separate controller classes, which may be separately overridden or enabled/deactivated.
  • Optionally, the entity API also helps providing an administrative interface for managing entities, e.g. the UI for managing profile types of Profile 2 is built with that.

Changes

Please consult the change records in order to get a list of important changes - applicable to site builders and developers! Do not forget to run update.php after updating.

Compatibility note: If the i18n Translation Sets module (i18n_translation) is used, an i18n version of 1.5 or later is required!

Drupal 8

  • The Drupal 8 core Entity API is significantly improved, so most of the features provided by the Drupal 7 version are already present in Drupal core.
  • The Drupal 8 version of the Entity API module is used for improvements to Drupal 8's Entity API which will be moved to Drupal core one day (development ongoing)

Credits

The project has been sponsored by

Maintainer

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

27 tracked projects depend on this one

Activity

Tracked releases
3
Tracked since
Feb 2025
Latest release
5 days ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
8.x-1.8 Stable 10–11 Aug 26, 2026
8.x-1.7 Stable 10–11 Aug 14, 2026
8.x-1.6 Stable 10–11 Feb 19, 2025