[module] Entity API

0
Project page quote (external)
Project page quoted on: 
2014-02-18

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.

Required by modules [Drupal7[

The move from the Drupal6 terminology 'content types' and CCK contruction kit to 'Entity' and 'Field' is more in line with Java Persistence API (JPA) database terminology and most other database persistence frameworks. This unifies the different sub-types like Node, User, etc under a universal base type Entity, which is a very good thing.

The unification of Field in core and the contributed Entity API module is not complete in Drupal7 !

From the Field API tutorial (and note that this is from the Field docs from core, not from the Entity API contributed modules docs):

'Entities

Nodes are one of the most used data containers in Drupal. Nodes are organized by node type. Nodes can behave differently, be themed differently, etc. based solely on their type. Nodes have a primary identifier (the node id or nid). Nodes also have a revisions identifier (the version id or vid).

Taxonomy term is another form of data for which different "behaviors" are collected in vocabularies. For example, the hierarchy can be different for each vocabulary.

In general, nodes and taxonomy terms are entities.

Entities are collected into bundles. For example, node.module defines its node types as bundles. The taxonomy.module also defines the vocabularies as bundles. User is simpler as it only defines the user bundle.

However, the comment module inherits the bundle from the node module which you can see from the entity called comment_node_$type (for example comment_node_article).

When you work with entities, use nodes as a mental “crutch” and node types for bundles.'

It is essential for Drupal7 developers that you read the Entity API Tutorial, and the web is full of screencast videos, presentations, and guides.

Visit also