function _fivestar_target_user_reference in Fivestar 7.2
Return value
array array('entity_type', 'entity_id').
1 string reference to '_fivestar_target_user_reference'
- fivestar_fivestar_target_info in ./
fivestar.module - Implements hook_fivestar_target_info().
File
- ./
fivestar.module, line 1020
Code
function _fivestar_target_user_reference($entity, $field, $instance, $langcode) {
$target = array();
$user_reference = $instance['settings']['target'];
if (isset($entity->{$user_reference}[$langcode][0]) && is_numeric($entity->{$user_reference}[$langcode][0]['uid'])) {
$target['entity_id'] = $entity->{$user_reference}[$langcode][0]['uid'];
$target['entity_type'] = 'user';
}
return $target;
}