You are here

function domain_conf_features_rebuild in Domain Access 7.3

Implements hook_features_rebuild().

1 call to domain_conf_features_rebuild()
domain_conf_features_revert in domain_conf/domain_conf.features.inc
Implements hook_features_revert().

File

domain_conf/domain_conf.features.inc, line 76
Features support for Domain Conf.

Code

function domain_conf_features_rebuild($module) {
  if ($defaults = domain_features_load($module, 'domain_conf_default_variables', TRUE)) {

    // Check for hard rebuild/revert.
    if ($wipe = domain_features_wipe_tables($defaults)) {
      domain_conf_data_delete('all');
      unset($defaults['wipe-domain-tables']);
    }
    foreach ($defaults as $key => $variables) {
      $domain_id = domain_load_domain_id($key);
      if (!$domain_id) {
        continue;
      }
      if (empty($variables)) {

        // Delete existing conf records.
        domain_conf_data_delete($domain_id);
      }
      else {

        // Save the new records, oevriding any old ones.
        domain_conf_data_set($domain_id, $variables, FALSE);
      }
    }
  }
}