You are here

function field_test_field_storage_details_alter in SimpleTest 7

Implement hook_field_storage_details_alter().

See also

FieldAttachStorageTestCase::testFieldStorageDetailsAlter()

File

tests/field_test.module, line 727

Code

function field_test_field_storage_details_alter(&$details, $field, $instance) {

  // 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['drupal_variables'] = array(
      FIELD_LOAD_CURRENT => array(
        'moon' => $columns,
      ),
      FIELD_LOAD_REVISION => array(
        'mars' => $columns,
      ),
    );
  }
}