You are here

protected function SearchApiGranular::getGranularity in Facets 8

Looks at the configuration for this facet to determine the granularity.

Default behaviour an integer for the steps that the facet works in.

Return value

int If not an integer the inheriting class needs to deal with calculations.

2 calls to SearchApiGranular::getGranularity()
SearchApiGranular::calculateRange in src/Plugin/facets/query_type/SearchApiGranular.php
Calculate the range for a given facet filter value.
SearchApiGranular::calculateResultFilter in src/Plugin/facets/query_type/SearchApiGranular.php
Calculate the grouped facet filter for a given value.

File

src/Plugin/facets/query_type/SearchApiGranular.php, line 100

Class

SearchApiGranular
Basic support for numeric facets grouping by a granularity value.

Namespace

Drupal\facets\Plugin\facets\query_type

Code

protected function getGranularity() {
  return $this->facet
    ->getProcessors()['granularity_item']
    ->getConfiguration()['granularity'];
}