function ref_field_encode in (Entity)Reference Field Synchronization 7
Returns a user fiendly verison of the ref_field value suitable for autocomplete form fields
Parameters
$entity_info: The entity type to format
$entity: The entity object to format
Return value
The value that should be returned by a form
1 call to ref_field_encode()
- ref_field_field_widget_form in ./
ref_field.module - Implements hook_field_widget_form().
File
- ./
ref_field.module, line 648
Code
function ref_field_encode($entity_type, $entity) {
// Get the entity info
$entity_info = entity_get_info($entity_type);
$id_column = $entity_info['entity keys']['id'];
return entity_label($entity_type, $entity) . ' | ' . $entity_type . ':' . $entity->{$id_column};
}