You are here

function facetapi_child_values_get in Facet API 6

Recursive function that returns an array of values for all descendants of a facet item.

Parameters

$build: A render array containing the facet item's children.

Return value

An array containing the values of all descendants.

1 call to facetapi_child_values_get()
FacetapiFacet::processQueryStrings in ./facetapi.adapter.inc
Initializes the render array's query string variables.

File

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

Code

function facetapi_child_values_get(array $build) {
  $values = array_keys($build);
  foreach ($build as $item) {
    if (!empty($item['#item_children'])) {
      $values = array_merge(facetapi_child_values_get($item['#item_children']), $values);
    }
  }
  return $values;
}