I have written this code inside a computed field, which has given me as result, the referenced entity numbers how are saved in the field as an array.
I would like to know how to extract from the entity number a specific field, such as the title.
foreach ($entity->field_campos as $field) {
}
foreach ($field as $index => $valores) {
$terminos[] = $valores['value'];
}
$item2 = field_collection_item_load_multiple($terminos, $reset = FALSE);
foreach ($item2 as $indice => $values) {
$entity_field[]['value'] = $values->field_nombre_2['und'][0]['target_id'];
}
// Display code (PHP).
$display_output = $entity_field_item['value'];
I am using Drupal 7.