function entity_reference_field_info

Implements hook_field_info().

File

drupal/core/modules/entity_reference/entity_reference.module, line 15
Provides a field that can reference other entities.

Code

function entity_reference_field_info() {
  $field_info['entity_reference'] = array(
    'label' => t('Entity Reference'),
    'description' => t('This field references another entity.'),
    'settings' => array(
      // Default to a primary entity type (i.e. node or user).
      'target_type' => module_exists('node') ? 'node' : 'user',
    ),
    'instance_settings' => array(
      // The selection handler for this instance.
      'handler' => 'default',
      // The handler settings.
      'handler_settings' => array(),
    ),
    'default_widget' => 'entity_reference_autocomplete',
    'default_formatter' => 'entity_reference_label',
    'data_type' => 'entity_reference_configurable_field',
    'field item class' => '\\Drupal\\entity_reference\\Type\\ConfigurableEntityReferenceItem',
  );
  return $field_info;
}