You are here

function facetapi_facet_load in Facet API 6

Same name and namespace in other branches
  1. 6.3 facetapi.module \facetapi_facet_load()
  2. 7.2 facetapi.module \facetapi_facet_load()
  3. 7 facetapi.module \facetapi_facet_load()

Loads a single facet definition.

NOTE: Facets aren't statically cached by this function, so avoid situations where this needs to be called repeatedly. Use facetapi_enabled_facets_get() as an alternative.

Parameters

$realm_name: A string containing the machine readable name of the realm.

$searcher: A string containing the machine readable name of the searcher module.

Return value

An array containing the facet definition, FALSE if $facet_name or $searcher is not valid.

File

./facetapi.module, line 164
An abstracted facet API that can be used by various search backens.

Code

function facetapi_facet_load($facet_name, $searcher) {
  if ($adapter = facetapi_adapter_load($searcher)) {
    $facets = facetapi_facets_get($searcher, $adapter
      ->getType());
    if (isset($facets[$facet_name])) {
      return $facets[$facet_name];
    }
  }
  return FALSE;
}