function hook_field_storage_create_field

Act on creation of a new field.

This hook is invoked from field_create_field() to ask the field storage module to save field information and prepare for storing field instances. If there is a problem, the field storage module should throw an exception.

Parameters

$field: The field structure being created.

Related topics

2 functions implement hook_field_storage_create_field()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

field_sql_storage_field_storage_create_field in drupal/core/modules/field/modules/field_sql_storage/field_sql_storage.module
Implements hook_field_storage_create_field().
field_test_field_storage_create_field in drupal/core/modules/field/tests/modules/field_test/field_test.storage.inc
Implements hook_field_storage_create_field().
1 invocation of hook_field_storage_create_field()
field_create_field in drupal/core/modules/field/field.crud.inc
Creates a field.

File

drupal/core/modules/field/field.api.php, line 1732

Code

function hook_field_storage_create_field($field) {
  $schema = _field_sql_storage_schema($field);
  foreach ($schema as $name => $table) {
    db_create_table($name, $table);
  }
  drupal_get_schema(NULL, TRUE);
}