You are here

public function FacetapiFilterCurrentDepth::execute in Facet API 7

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

Implements FacetapiFilter::execute().

Overrides FacetapiFilter::execute

File

plugins/facetapi/filter.inc, line 146
Base filter class and core implementations.

Class

FacetapiFilterCurrentDepth
Plugin that filters all items not in current 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;
}