You are here

function _range_views_data_base_information in Range 7

Helper function. Returns misc data for a given field.

This function returns misc field data, that is required by various Views plugins. Data includes field label, current and revision table names, field columns.

Field data is being statically cached.

Parameters

array $field: Field definition.

Return value

array Field data array containing:

  • Field label
  • Name of the table that contains current revision data for a given field
  • Name of the table that contains historical data for a given field
  • Array of field data columns keyed by column name.
2 calls to _range_views_data_base_information()
_range_views_data_argument_handler in views/range.views.inc
Provides views argument handler data.
_range_views_data_filter_handler in views/range.views.inc
Provides views filter handler data.

File

views/range.views.inc, line 90
Implementation of Views API.

Code

function _range_views_data_base_information(array $field) {
  static $information = array();
  if (empty($information[$field['field_name']])) {
    list($label) = field_views_field_label($field['field_name']);
    $add_fields = array();
    foreach ($field['columns'] as $column_name => $attributes) {
      $add_fields[$column_name] = _field_sql_storage_columnname($field['field_name'], $column_name);
    }
    $information[$field['field_name']] = array(
      $label,
      _field_sql_storage_tablename($field),
      _field_sql_storage_revision_tablename($field),
      $add_fields,
    );
  }
  return $information[$field['field_name']];
}