Defines available data types for the typed data API.
The typed data API allows modules to support any kind of data based upon pre-defined primitive types and interfaces for complex data and lists.
Defined data types may map to one of the pre-defined primitive types in \Drupal\Core\TypedData\Primitive or may be complex data types, containing one or more data properties. Typed data objects for complex data types have to implement the \Drupal\Core\TypedData\ComplexDataInterface. Further interfaces that may be implemented are:
Furthermore, lists of data items are represented by objects implementing the \Drupal\Core\TypedData\ListInterface. A list contains items of the same data type, is ordered and may contain duplicates. The classed used for a list of items of a certain type may be specified using the 'list class' key.
array An associative array where the key is the data type name and the value is again an associative array. Supported keys are:
Drupal\Core\TypedData\TypedDataManager::create()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
function hook_data_type_info() {
return array(
'email' => array(
'label' => t('Email'),
'class' => '\\Drupal\\email\\Type\\Email',
'primitive type' => \Drupal\Core\TypedData\Primitive::String,
),
);
}