function drupal_schema_field_types

Retrieves the type for every field in a table schema.

Parameters

$table: The name of the table from which to retrieve type information.

Return value

An array of types, keyed by field name.

Related topics

1 call to drupal_schema_field_types()
entity_get_info in drupal/includes/common.inc
Get the entity info array of an entity type.

File

drupal/includes/common.inc, line 7229
Common functions that many Drupal modules will need to reference.

Code

function drupal_schema_field_types($table) {
  $table_schema = drupal_get_schema($table);
  $field_types = array();
  foreach ($table_schema['fields'] as $field_name => $field_info) {
    $field_types[$field_name] = isset($field_info['type']) ? $field_info['type'] : NULL;
  }
  return $field_types;
}