You are here

public function FacetapiFilterCurrentDepth::execute in Facet API 6.3

Same name and namespace in other branches
  1. 7.2 plugins/facetapi/filter.inc \FacetapiFilterCurrentDepth::execute()
  2. 7 plugins/facetapi/filter.inc \FacetapiFilterCurrentDepth::execute()

Filters active facet items.

Overrides FacetapiFilter::execute

File

plugins/facetapi/filter.inc, line 111
Base filter class and implementation.

Class

FacetapiFilterCurrentDepth
Plugin that filters all items not in lowest hierarchy.

Code

public function execute(array $build) {
  foreach ($build as $item) {
    if ($item['#active'] && !empty($item['#item_children'])) {
      return $this
        ->execute($item['#item_children']);
    }
  }
  return $build;
}