function getlocations_get_fieldname2 in Get Locations 7.2
Same name and namespace in other branches
- 7 getlocations.module \getlocations_get_fieldname2()
Function to collect field names
Parameters
string $bundle:
string $entity_type:
Return value
Returns field names or FALSE
1 call to getlocations_get_fieldname2()
- getlocations_mapquest_field_formatter_view in modules/
getlocations_mapquest/ getlocations_mapquest.module - Implements hook_field_formatter_view(). Build a renderable array for a field value.
File
- ./
getlocations.module, line 2115 - getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Code
function getlocations_get_fieldname2($bundle, $entity_type = 'node') {
$module = getlocations_get_current_supported_module();
if ($module) {
$query = db_select('field_config', 'f');
$query
->fields('f', array(
'field_name',
));
$query
->join('field_config_instance', 'i', 'f.id=i.field_id');
$query
->condition('i.bundle', $bundle)
->condition('f.module', $module)
->condition('i.entity_type', $entity_type)
->condition('f.active', 1);
$rows = $query
->execute();
$ct = 0;
foreach ($rows as $row) {
$data[$ct] = $row->field_name;
$ct++;
}
if ($ct) {
return $data;
}
}
return FALSE;
}