You are here

function facetapi_ids_replace in Facet API 6

Replaces ID's with a mapped value, useful as a callback for array_walk().

Parameters

&$item: An array containing the facet item.

$key: An integer containing the array key, or the ID being mapped to a value.

$map: An array containing the mapped values.

1 string reference to 'facetapi_ids_replace'
FacetapiFacet::buildItems in ./facetapi.adapter.inc
Builds the render array for the facet's items.

File

./facetapi.adapter.inc, line 702
Defines classes used by the FacetAPI module.

Code

function facetapi_ids_replace(array &$item, $key, array $map) {
  if (isset($map[$key])) {
    $item['#value'] = $map[$key];
  }
}