function globallink_file_entity_get_fields in GlobalLink Connect for Drupal 7.7
Gets file entity fields based on bundle.
Parameters
string $bundle: The bundle.
Return value
array Array of fields.
2 calls to globallink_file_entity_get_fields()
- globallink_file_entity_import in globallink_file_entity/
globallink_file_entity.inc - Updates the file entity with translation.
- globallink_get_file_entity_xml in globallink_file_entity/
globallink_file_entity.inc
File
- globallink_file_entity/
globallink_file_entity.inc, line 162
Code
function globallink_file_entity_get_fields($bundle) {
$fields = array();
$info = entity_get_info('file');
foreach ($info['bundles'] as $bundle_name => $bundle_info) {
if ($bundle_name == $bundle) {
foreach (field_info_instances('file', $bundle_name) as $field) {
$fields[] = $field['field_name'];
}
}
}
return $fields;
}