hook_field_storage_details_alter

function hook_field_storage_details_alter

hook_field_storage_details_alter(&$details, $field)

Perform alterations on Field API storage details.

Parameters

$details: An array of storage details for fields as exposed by hook_field_storage_details() implementations.

$field: A field structure.

See also

hook_field_storage_details()

Related topics

File

modules/field/field.api.php, line 1743
Hooks provided by the Field module.

Code

function hook_field_storage_details_alter(&$details, $field) {
  if ($field['field_name'] == 'field_of_interest') {
    $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,
      ),
    );
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!field.api.php/function/hook_field_storage_details_alter/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部