function field_test_field_storage_create_field

7.x field_test.storage.inc field_test_field_storage_create_field($field)

Implements hook_field_storage_create_field().

File

drupal/modules/field/tests/field_test.storage.inc, line 370
Defines a field storage backend.

Code

function field_test_field_storage_create_field($field) {
  if ($field['storage']['type'] == 'field_test_storage_failure') {
    throw new Exception('field_test_storage_failure engine always fails to create fields');
  }

  $data = _field_test_storage_data();

  $data[$field['id']] = array(
    'current' => array(),
    'revisions' => array(),
  );

  _field_test_storage_data($data);
}