function globallink_bean_get_fields in GlobalLink Connect for Drupal 7.6
Same name and namespace in other branches
- 7.7 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_translated in globallink_beans/
globallink_beans.inc - Gets number of translated beans.
- globallink_beans_get_xml in globallink_beans/
globallink_beans.inc - Gets XML data from specific bean.
File
- globallink_beans/
globallink_beans.inc, line 420
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;
}