From a243e821fa8c19f5cdaae5af0495fcccdda70125 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 14 Oct 2009 14:55:12 +0000 Subject: - Pactch #569224 by bangpound: expose field storage details through field attach. --- modules/field/field.api.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'modules/field/field.api.php') diff --git a/modules/field/field.api.php b/modules/field/field.api.php index 60e54d5d8..84a9b07e9 100644 --- a/modules/field/field.api.php +++ b/modules/field/field.api.php @@ -1140,6 +1140,47 @@ function hook_field_storage_info_alter(&$info) { ); } +/** + * Reveal the internal details about the storage for a field. + * + * For example, an SQL storage module might return the Schema API structure for + * the table. A key/value storage module might return the server name, + * authentication credentials, and bin name. + * + * Field storage modules are not obligated to implement this hook. Modules + * that rely on these details must only use them for read operations. + * + * @param $field + * A field structure. + * @param $instance + * A field instance structure. + * @return + * An array of details. + * - The first dimension is a store type (sql, solr, etc). + * - The second dimension indicates the age of the values in the store + * FIELD_LOAD_CURRENT or FIELD_LOAD_REVISION. + * - Other dimensions are specific to the field storage module. + */ +function hook_field_storage_details($field, $instance) { +} + +/** + * Perform alterations on Field API storage details. + * + * The storage details are appended to the field instance structure after this + * hook is invoked. Read and alter the $details only. + * + * @param $details + * An array of storage details for fields as exposed by + * hook_field_storage_details() implementations. + * @param $field + * A field structure. + * @param $instance + * A field instance structure. + */ +function hook_field_storage_details_alter(&$details, $field, $instance) { +} + /** * Load field data for a set of objects. * -- cgit v1.2.3