I am trying to accomplish something like this, but it does not work:

$entity_field[0]['value'] = array_pop(array_pop(field_get_items('comment', $entity, 'field_cost')));

The computed field is on the content node but the information is for the computation is on the comment.

Comment 1 field_important_info

Comment 2 field_important_info

In a case where the field is on the content node, it is quite easy: $entity_field[0]['value'] = $entity->field_important_info[LANGUAGE_NONE][0]['value'];

Is the only way to do this through query or is there an easier way? Any hints on 1 value or multiple values from comments are appreciated.