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
Features
This is an API module, so it doesn't provide any end-user features. However, users may enable the entity tokens module, which provides token replacements for all entity properties that have no tokens and are known to the entity API.
Documentation
You can find documentation in the handbooks. Also check the README and the provided API docs in entity.api.php.
Overview
-
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()andentity_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
Entityclass. - The entity API cares about creating fieldable entities as well as exportable entities, however it does not yet support revisions. 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.
Stable release:
What's missing for 1.0? See this list.
Sponsors
Maintainer
The maintainer provides paid development and consulting services. Help improving the module and get in contact!
Downloads
Recommended releases
Development releases
Project Information
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Developer
- Reported installs: 72161 sites currently report using this module. View usage statistics.
- Automated tests: Enabled
- Last modified: January 25, 2012