You are here

function _field_object_expand_path in Corresponding Entity References 7.3

Helper function. Expands a field reference's path value into an array of field and instance definitions.

1 call to _field_object_expand_path()
field_object_field_formatter_view in field_object/field_object.module
Implements hook_field_formatter_view().

File

field_object/field_object.module, line 136

Code

function _field_object_expand_path($path) {
  $output = array();
  foreach (explode('::', $path) as $instance) {
    list($entity_type, $bundle, $field) = explode(':', $instance);
    $output[] = array(
      'field' => field_info_field($field),
      'instance' => field_info_instance($entity_type, $field, $bundle),
    );
  }
  return $output;
}