You are here

function hook_data_default in Data 7

Same name and namespace in other branches
  1. 8 data.api.php \hook_data_default()
  2. 6 data.api.php \hook_data_default()

Expose default tables.

Note:

  • Implementor is responsible for creating this table on installation and for proper updates in case of schema changes (hook_install(), hook_update_N())
  • Implement hook_ctools_plugin_api() to make this hook discoverable by CTools - see below.
1 function implements hook_data_default()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

data_ui_test_data_default in data_ui/tests/data_ui_test.module
Implements hook_data_default().

File

./data.api.php, line 36
Documentation of hooks.

Code

function hook_data_default() {
  $export = array();
  $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 = 'Example';
  $data_table->name = 'data_table_example';
  $data_table->table_schema = array(
    'fields' => array(
      'id' => array(
        'type' => 'int',
        'size' => 'normal',
        'unsigned' => TRUE,
      ),
    ),
    'primary key' => array(
      '0' => 'id',
    ),
  );
  $data_table->meta = array(
    'fields' => array(
      'id' => array(
        'label' => 'Identifier',
      ),
    ),
  );
  $export['data_table_example'] = $data_table;
  return $export;
}