You are here

function field_reference_entity_get_info in Field reference 7

Get data about supported entity types.

3 calls to field_reference_entity_get_info()
field_reference_field_formatter_view in ./field_reference.module
Implements hook_field_formatter_view().
field_reference_label_create in ./field_reference.module
Compose a field reference label.
_field_reference_potential_references_standard in ./field_reference.module
Helper function for field_reference_potential_references().

File

./field_reference.module, line 1270
Defines a field type for referencing a field from another.

Code

function field_reference_entity_get_info($entity_type = NULL) {
  $entity_info = entity_get_info($entity_type);
  if ($entity_type == 'user') {
    $entity_info['entity keys']['label'] = 'name';
  }
  elseif (!empty($entity_info['user'])) {
    $entity_info['user']['entity keys']['label'] = 'name';
  }
  return $entity_info;
}