You are here

function field_test_field_storage_create_field in Drupal 7

Implements hook_field_storage_create_field().

File

modules/field/tests/field_test.storage.inc, line 265
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);
}