function globallink_bean_get_fields in GlobalLink Connect for Drupal 7.7
Same name and namespace in other branches
- 7.6 globallink_beans/globallink_beans.inc \globallink_bean_get_fields()
Gets bean fields based on bundle.
Parameters
string $bundle: The bundle.
Return value
array Array of fields.
2 calls to globallink_bean_get_fields()
- globallink_beans_get_xml in globallink_beans/
globallink_beans.inc - Gets XML data from specific bean.
- globallink_beans_import in globallink_beans/
globallink_beans.inc - Gets number of translated beans.
File
- globallink_beans/
globallink_beans.inc, line 360
Code
function globallink_bean_get_fields($bundle) {
$fields = array();
$info = entity_get_info('bean');
foreach ($info['bundles'] as $bundle_name => $bundle_info) {
if ($bundle_name == $bundle) {
foreach (field_info_instances('bean', $bundle_name) as $field) {
$fields[] = $field['field_name'];
}
}
}
return $fields;
}