You are here

function data_get_pk_definition in Data 8

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

Get a Schema API PK definition for a given field type.

File

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

Code

function data_get_pk_definition($field_name, $spec) {
  if ($spec['type'] == 'text') {
    return array(
      $field_name,
      255,
    );
  }
  else {
    return $field_name;
  }
}