You are here

function data_get_field_definitions in Data 7

Same name and namespace in other branches
  1. 8 data.module \data_get_field_definitions()
  2. 6 data.module \data_get_field_definitions()

Get a list of supported field definitions.

This list is a sub set of Schema API data types http://drupal.org/node/159605 The keys are simplified handles.

2 calls to data_get_field_definitions()
data_get_field_definition in ./data.module
Get a definition key into a schema API type definition.
data_get_field_types in ./data.module
Get schema API field types supported by Data module.

File

./data.module, line 115
Hooks and API functions for data module.

Code

function data_get_field_definitions() {
  $built_in = array(
    'int' => array(
      'type' => 'int',
      'not null' => FALSE,
    ),
    'unsigned int' => array(
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => FALSE,
    ),
    'serial' => array(
      'type' => 'serial',
      'unsigned' => TRUE,
      'not null' => TRUE,
    ),
    'varchar' => array(
      'type' => 'varchar',
      'length' => 255,
      'not null' => FALSE,
    ),
    'text' => array(
      'type' => 'text',
      'not null' => FALSE,
    ),
    'bigtext' => array(
      'type' => 'text',
      'not null' => FALSE,
      'size' => 'big',
    ),
    'float' => array(
      'type' => 'float',
      'size' => 'medium',
      'not null' => FALSE,
    ),
    'double' => array(
      'type' => 'float',
      'size' => 'big',
      'not null' => FALSE,
    ),
    'geometry' => array(
      'type' => 'geometry',
      'mysql_type' => 'geometry',
      'pgsql_type' => 'geometry',
    ),
  );
  drupal_alter('data_field_definitions', $built_in);
  return $built_in;
}