You are here

function filefield_paths_features_rebuild in File (Field) Paths 6

Create/recreate the items based on the data array. Data should contain a number of filefield_paths definitions.

Implements hook_features_export_rebuild().

Data just need to be put straight into the database as rows.

1 call to filefield_paths_features_rebuild()
filefield_paths_features_revert in modules/features.inc
Implements hook_features_export_revert().

File

modules/features.inc, line 194
Features module integration.

Code

function filefield_paths_features_rebuild($module) {
  if ($defaults = features_get_default('filefield_paths', $module)) {
    foreach ($defaults as $filefield_paths_id => $filefield_paths) {

      // Delete any previous settings for this item.
      if (filefield_paths_load($filefield_paths_id)) {
        filefield_paths_delete($filefield_paths_id);
      }
      drupal_write_record('filefield_paths', $filefield_paths);
    }
  }
}