Drill into computed field entity data I am using Drupal 7. I installed the computed field module and have a computed field in a content type. I need to be able to access the actual name of a node reference field that is in the same content type so i can then work with the data in the computed field. Currently I can only get the number of the node reference field using this in the computed code (php) field:

    $entity_field[0]['value'] = array_pop(field_get_items($entity_type, $entity, 'field_charity_reference'));


I need to be able to access a 'drill' into the the node reference to get the rendered title, which is a human readable name.

When using views and custom php I can use dpm($data); to explore the data and use this to work out I can access the rendered title by using:

    $data-&gt;field_field_charity_reference[0]['rendered']['#title']


Since originally posting this question I have found i can use dpm(field_get_items($entity_type, $entity, 'field_charity_reference')); in the 'Display Code (PHP)' input in the computed field to give a devel printout of the field I wish to access data from. 

I would like to know how to drill into the results returned by field_get_items($entity_type, $entity, 'field_charity_reference') in order to output the name of the node reference field. Thanks
Procedurally:

if ($field_items = field_get_items('node', $node, 'field_charity_reference')) {
  $referenced_node = node_load($field_items[0]['target_id']);
  $title = $referenced_node-&gt;title;
}


Or OO'ly with the Entity API module:

$node_wrapper = entity_metadata_wrapper('node', $node);
$title = $node_wrapper-&gt;field_charity_reference-&gt;value()-&gt;title;


If you go the OO route this post will probably come in handy