You are here

function _better_statistics_define_fields in Better Statistics 6

Returns field definitions for fields added by this module.

Parameters

$description: Boolean value indicating whether or not to include the field description.

Return value

An array of field definition arrays keyed by field name.

4 calls to _better_statistics_define_fields()
better_statistics_install in ./better_statistics.install
Implements hook_install().
better_statistics_schema_alter in ./better_statistics.module
Implements hook_schema_alter().
better_statistics_uninstall in ./better_statistics.install
Implements hook_uninstall().
better_statistics_views_data_alter in views/better_statistics.views.inc
Implements hook_views_data_alter().

File

./better_statistics.helpers.inc, line 18
Helper functions for the Better Statistics module.

Code

function _better_statistics_define_fields($description = FALSE) {
  $definition['cache'] = array(
    'type' => 'varchar',
    'length' => 128,
    'not null' => FALSE,
    'description' => 'Cache hit, miss, or not applicable.',
  );
  $definition['user_agent'] = array(
    'type' => 'varchar',
    'length' => 255,
    'not null' => FALSE,
    'description' => 'User-agent string used on the request.',
  );

  // Remove the description field if desired.
  if (!$description) {
    foreach ($definition as &$field) {
      unset($field['description']);
    }
  }
  return $definition;
}