You are here

function globallink_eck_get_fields in GlobalLink Connect for Drupal 7.7

1 call to globallink_eck_get_fields()
globallink_eck_import in globallink_custom_entity/globallink_custom_entity.inc

File

globallink_custom_entity/globallink_custom_entity.inc, line 415

Code

function globallink_eck_get_fields($entity_bundle, $entity_type) {
  $fields = array();
  $info = entity_get_info($entity_type);
  foreach ($info['bundles'] as $bundle_name => $bundle_info) {
    if ($bundle_name == $entity_bundle) {
      foreach (field_info_instances($entity_type, $bundle_name) as $field) {
        $fields[] = $field['field_name'];
      }
    }
  }
  return $fields;
}