1 entityreference.module entityreference_field_type_settings($field)

Introspects field and instance settings, and determines the correct settings for the functioning of the formatter.

Settings:

  • entity_type - The entity_type being loaded.
  • column - The name of the ref. field column that stores the entity id.

File

core/modules/entityreference/entityreference.module, line 1094
Entityreference primary module file.

Code

function entityreference_field_type_settings($field) {
  $settings = array(
    'entity_type' => NULL,
    'column' => NULL,
  );

  if ($field['type'] == 'entityreference') {
    $settings['entity_type'] = $field['settings']['target_type'];
    $settings['column'] = 'target_id';
  }
  elseif ($field['type'] == 'taxonomy_term_reference') {
    $settings['entity_type'] = 'taxonomy_term';
    $settings['column'] = 'tid';
  }

  return $settings;
}