You are here

function schema_schema_type in Schema 5

Same name and namespace in other branches
  1. 8 schema.module \schema_schema_type()
  2. 6 schema.module \schema_schema_type()
  3. 7 schema.module \schema_schema_type()
3 calls to schema_schema_type()
schema_compare_table in ./schema.module
schema_mysql_inspect in engines/schema_mysql.inc
schema_pgsql_inspect in engines/schema_pgsql.inc

File

./schema.module, line 170

Code

function schema_schema_type($type, $table, $field, $engine = NULL) {
  $map = schema_engine_invoke($engine, 'schema_type_map');
  $type = strtolower($type);
  if (isset($map[$type])) {
    return explode(':', $map[$type]);
  }
  else {
    drupal_set_message(t('Field %table.%field: no Schema type for %engine type %type.', array(
      '%engine' => $engine,
      '%type' => $type,
      '%table' => $table,
      '%field' => $field,
    )), 'error');
    return array(
      $type,
      'normal',
    );
  }
}