function field_test_field_storage_details_alter

Implements hook_field_storage_details_alter().

See also

FieldAttachStorageTestCase::testFieldStorageDetailsAlter()

File

modules/field/tests/field_test.storage.inc, line 49

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.