You are here

function schema_schema_type in Schema 6

Same name and namespace in other branches
  1. 8 schema.module \schema_schema_type()
  2. 5 schema.module \schema_schema_type()
  3. 7 schema.module \schema_schema_type()

Convert an engine-specific data type into a Schema type.

3 calls to schema_schema_type()
schema_compare_table in ./schema.module
Compares a reference specification (such as one returned by a module's hook_schema) to an inspected specification from the database.
schema_mysql_inspect in engines/schema_mysql.inc
schema_pgsql_inspect in engines/schema_pgsql.inc

File

./schema.module, line 213
The Schema module provides functionality built on the Schema API.

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 {
    if (!variable_get('schema_suppress_type_warnings', FALSE)) {
      drupal_set_message(t('Field @table.@field: no Schema type for @engine type @type.', array(
        '@engine' => $engine,
        '@type' => $type,
        '@table' => $table,
        '@field' => $field,
      )), 'warning');
    }
    return array(
      $type,
      'normal',
    );
  }
}