1 views_query.test protected ViewsSqlTest::viewsData()

The views data definition.

File

core/modules/views/tests/views_query.test, line 237
Tests for Views query features.

Class

ViewsSqlTest

Code

protected function viewsData() {
  // Declaration of the base table.
  $data['views_test']['table'] = array(
    'group' => t('Views test'),
    'base' => array(
      'field' => 'id',
      'title' => t('Views test'),
      'help' => t('Users who have created accounts on your site.'),
    ),
  );

  // Declaration of fields.
  $data['views_test']['id'] = array(
    'title' => t('ID'),
    'help' => t('The test data ID'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['views_test']['name'] = array(
    'title' => t('Name'),
    'help' => t('The name of the person'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_string',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_string',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['views_test']['age'] = array(
    'title' => t('Age'),
    'help' => t('The age of the person'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['views_test']['job'] = array(
    'title' => t('Job'),
    'help' => t('The job of the person'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_string',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_string',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['views_test']['created'] = array(
    'title' => t('Created'),
    'help' => t('The creation date of this record'),
    'field' => array(
      'handler' => 'views_handler_field_date',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_date',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_date',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort_date',
    ),
  );
  return $data;
}