Implements hook_data_type_info() to register data types for all field types.
function field_data_type_info() {
$field_types = field_info_field_types();
$items = array();
// Expose data types for all the field type items.
// @todo: Make 'field item class' mandatory.
foreach ($field_types as $type_name => $type_info) {
if (!empty($type_info['field item class'])) {
$items[$type_name . '_field'] = array(
'label' => t('Field !label item', array(
'!label' => $type_info['label'],
)),
'class' => $type_info['field item class'],
'list class' => !empty($type_info['field class']) ? $type_info['field class'] : '\\Drupal\\Core\\Entity\\Field\\Type\\Field',
);
}
}
return $items;
}