You are here

class FacetapiFilterCurrentDepth in Facet API 6.3

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

Plugin that filters all items not in lowest hierarchy.

Hierarchy

Expanded class hierarchy of FacetapiFilterCurrentDepth

1 string reference to 'FacetapiFilterCurrentDepth'
facetapi_facetapi_filters in ./facetapi.facetapi.inc
Implements hook_facetapi_filters().

File

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

View source
class FacetapiFilterCurrentDepth extends FacetapiFilter {

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

}

Members

Namesort descending Modifiers Type Description Overrides
FacetapiFilter::$adapter protected property The adapter object.
FacetapiFilter::$id protected property The ID of this plugin.
FacetapiFilter::$settings protected property The facet settings.
FacetapiFilter::getDefaultSettings public function Returns default settings added to the settings form.
FacetapiFilter::settingsForm public function Adds settings to the filter form.
FacetapiFilter::__construct public function Initializes the filter object.
FacetapiFilterCurrentDepth::execute public function Filters active facet items. Overrides FacetapiFilter::execute