You are here

function _fivestar_target_node_reference in Fivestar 7.2

Return value

array array('entity_type', 'entity_id').

1 string reference to '_fivestar_target_node_reference'
fivestar_fivestar_target_info in ./fivestar.module
Implements hook_fivestar_target_info().

File

./fivestar.module, line 984

Code

function _fivestar_target_node_reference($entity, $field, $instance, $langcode) {
  $target = array();
  $node_reference = $instance['settings']['target'];
  if (isset($entity->{$node_reference}[$langcode][0]) && is_numeric($entity->{$node_reference}[$langcode][0]['nid'])) {
    $target['entity_id'] = $entity->{$node_reference}[$langcode][0]['nid'];
    $target['entity_type'] = 'node';
  }
  return $target;
}