1 field_test.storage.inc field_test_field_storage_details_alter(&$details, $field)

Implements hook_field_storage_details_alter().

See also

FieldAttachStorageTestCase::testFieldStorageDetailsAlter()

File

core/modules/field/tests/field_test/field_test.storage.inc, line 49
Defines a field storage backend.

Code

function field_test_field_storage_details_alter(&$details, $field) {

  // For testing, storage details are changed only because of the field name.
  if ($field['field_name'] == 'field_test_change_my_details') {
    $columns = array();
    foreach ((array) $field['columns'] as $column_name => $attributes) {
      $columns[$column_name] = $column_name;
    }
    $details['backdrop_variables'] = array(
      FIELD_LOAD_CURRENT => array(
        'moon' => $columns,
      ),
      FIELD_LOAD_REVISION => array(
        'mars' => $columns,
      ),
    );
  }
}