Data types

Last updated on
14 October 2016

These are the data types to be used for describing entity properties:

Type Useage
text Any text.
token A string containing only lowercase letters, numbers, and underscores; e.g. this type is useful for machine readable names.
integer A usual PHP integer value.
decimal A PHP float or integer.
date A full date and time, as timestamp.
duration A duration as number of seconds.
boolean A usual PHP boolean value.
uri An absolute URI or URL.
entities You may use the type of each entity known by hook_entity_info(), e.g. 'node' or 'user'. Internally entities are represented by their identifiers.
entity A special type to be used generically for entities where the entity type is not known beforehand. The entity has to be represented using an EntityMetadataWrapper.
struct This as well as any else not known type may be used for supporting arbitrary data structures. For that additional metadata has to be specified with the 'property info' key.
list A list of values, represented as numerically indexed array. The list<TYPE> notation may be used to specify the type of the contained items, where TYPE may be any valid type expression. E.g. use list<node> for a list of nodes.