You are here

function _heartbeat_get_fields in Heartbeat 6.4

Same name and namespace in other branches
  1. 6.3 heartbeat.common.inc \_heartbeat_get_fields()

Helper function to get the fields

1 call to _heartbeat_get_fields()
heartbeat_views_views_query_alter in views/heartbeat_views.views.inc
Implementation of hook_views_query_alter().

File

./heartbeat.common.inc, line 101
Commonly functions used in heartbeat

Code

function _heartbeat_get_fields($table) {
  $fields = array();
  $schema = drupal_get_schema($table, TRUE);

  // Go through our schema
  foreach ($schema['fields'] as $field => $info) {
    $fields[$field] = !empty($info['alias']) ? $info['alias'] : $field;
  }
  return $fields;
}