On this page
function field_associate_fields
field_associate_fields($module)
Allows a module to update the database for fields and columns it controls.
Parameters
$module: The name of the module to update on.
Related topics
File
- modules/field/field.module, line 450
- Attach custom data fields to Drupal entities.
Code
function field_associate_fields($module) {
// Associate field types.
$field_types = (array) module_invoke($module, 'field_info');
if ($field_types) {
db_update('field_config')
->fields(array('module' => $module, 'active' => 1))
->condition('type', array_keys($field_types))
->execute();
}
// Associate storage backends.
$storage_types = (array) module_invoke($module, 'field_storage_info');
if ($storage_types) {
db_update('field_config')
->fields(array('storage_module' => $module, 'storage_active' => 1))
->condition('storage_type', array_keys($storage_types))
->execute();
}
}
© 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.module/function/field_associate_fields/7.x