You are here

function data_ui_test_data_default in Data 6

Same name and namespace in other branches
  1. 7 data_ui/tests/data_ui_test.module \data_ui_test_data_default()

Implementation of hook_data_default().

1 call to data_ui_test_data_default()
data_ui_test_schema in data_ui/tests/data_ui_test.install
Implementation of hook_schema().

File

data_ui/tests/data_ui_test.module, line 21
Test module for data_ui.test .

Code

function data_ui_test_data_default() {
  $data_table = new stdClass();
  $data_table->disabled = FALSE;

  /* Edit this to true to make a default data_table disabled initially */
  $data_table->api_version = 1;
  $data_table->title = 'Kittens';
  $data_table->name = 'data_table_kittens';
  $data_table->table_schema = array(
    'fields' => array(
      'id' => array(
        'type' => 'int',
        'size' => 'normal',
        'disp-width' => '10',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'name' => array(
        'type' => 'varchar',
        'size' => 'normal',
        'length' => '255',
        'not null' => FALSE,
      ),
      'age' => array(
        'type' => 'varchar',
        'size' => 'normal',
        'length' => '255',
        'not null' => FALSE,
      ),
      'color' => array(
        'type' => 'varchar',
        'size' => 'normal',
        'length' => '255',
        'not null' => FALSE,
      ),
    ),
    'name' => 'data_table_kittens',
    'indexes' => array(
      'id' => array(
        '0' => 'id',
      ),
      'name' => array(
        '0' => 'name',
      ),
    ),
    'primary key' => array(
      '0' => 'id',
    ),
  );
  $data_table->meta = array(
    'fields' => array(
      'id' => array(
        'label' => 'Id',
      ),
      'name' => array(
        'label' => 'Name',
      ),
      'age' => array(
        'label' => 'Age',
      ),
      'color' => array(
        'label' => 'Color',
      ),
    ),
    'join' => array(
      'node' => array(
        'left_field' => 'nid',
        'field' => 'id',
        'inner_join' => '1',
      ),
    ),
  );
  $data_tables['data_table_kittens'] = $data_table;
  return $data_tables;
}