You are here

function dimension_field_schema in Dimension 7

Implements hook_field_schema().

File

./dimension.install, line 6

Code

function dimension_field_schema($field) {
  list($has_length, $has_more) = _dimension_get_modes($field['settings']['mode']);
  $columns = array();
  if ($has_length) {
    $columns['length'] = array(
      'type' => 'varchar',
      'length' => 10,
      'not null' => FALSE,
    );
  }
  if ($has_more) {
    $columns['width'] = array(
      'type' => 'varchar',
      'length' => 10,
      'not null' => FALSE,
    );
    $columns['height'] = array(
      'type' => 'varchar',
      'length' => 10,
      'not null' => FALSE,
    );
  }
  return array(
    'columns' => $columns,
    'indexes' => array(),
  );
}