You are here

public function FacetapiAdapter::setParams in Facet API 7.2

Same name and namespace in other branches
  1. 6.3 plugins/facetapi/adapter.inc \FacetapiAdapter::setParams()
  2. 7 plugins/facetapi/adapter.inc \FacetapiAdapter::setParams()

Processes and stores the extracted facet data.

Uses the url processor plugin to normalize the data extracted from the source and store it for later retrieval. Calls the active item processing routine, see FacetapiAdapter::processActiveItems() for more details.

Parameters

array $params: An array of keyed params, such as $_GET.

string $filter_key: The array key in $params containing the facet data.

Return value

FacetapiAdapter An instance of this class.

See also

FacetapiUrlProcessor::normalizeParams()

FacetapiAdapter::processActiveItems()

1 call to FacetapiAdapter::setParams()
FacetapiAdapter::initUrlProcessor in plugins/facetapi/adapter.inc
Extracts, stores, and processes facet data.

File

plugins/facetapi/adapter.inc, line 268
Adapter plugin and adapter related classes.

Class

FacetapiAdapter
Abstract class extended by Facet API adapters.

Code

public function setParams(array $params = array(), $filter_key = 'f') {
  $this->facets = array();
  $normalized = $this->urlProcessor
    ->normalizeParams($params, $filter_key);
  $this->urlProcessor
    ->setParams($normalized, $filter_key);
  $this
    ->processActiveItems();
  return $this;
}