You are here

function facetapi_map_assoc in Facet API 7

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

Wrapper around drupal_map_assoc() for a key in all items of an array.

Useful as an array_walk() callback.

Parameters

array &$array: The array being modified.

string $name: The key of the array being modified, usually the name of a definition.

array $key: The key in the array being passed to drupal_map_assoc().

2 string references to 'facetapi_map_assoc'
facetapi_get_facet_info in ./facetapi.module
Returns all defined facet definitions available to the searcher.
facetapi_get_searcher_info in ./facetapi.module
Returns all defined searcher definitions.

File

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

Code

function facetapi_map_assoc(&$array, $name, $key) {
  if (array_key_exists($key, $array)) {
    $array[$key] = drupal_map_assoc($array[$key]);
  }
}