You are here

function apachesolr_save_module_facets in Apache Solr Search 6

Same name and namespace in other branches
  1. 5.2 apachesolr.module \apachesolr_save_module_facets()
  2. 6.2 apachesolr.module \apachesolr_save_module_facets()

Save the enabled facets for one module.

Parameters

$module: The module name.

$facets: Associative array of $delta => $facet_field pairs. If omitted, all facets for $module are disabled.

Return value

An array consisting of info for all enabled facets.

1 call to apachesolr_save_module_facets()
apachesolr_og_disable in contrib/apachesolr_og/apachesolr_og.install
Implementation of hook_disable().

File

./apachesolr.module, line 739
Integration with the Apache Solr search application.

Code

function apachesolr_save_module_facets($module, $facets = array()) {
  $enabled = variable_get('apachesolr_enabled_facets', array());
  if (!empty($facets) && is_array($facets)) {
    $enabled[$module] = $facets;
  }
  else {
    unset($enabled[$module]);
  }
  variable_set('apachesolr_enabled_facets', $enabled);
  return $enabled;
}