You are here

public function SearchApiFacetapiExampleService::supportsFeature in Search API 7

Determines whether this service class implementation supports a given feature. Features are optional extensions to Search API functionality and usually defined and used by third-party modules.

If the service class supports facets, it should return TRUE if called with the feature name "search_api_facets". If it also supports "OR" facets, it should also return TRUE if called with "search_api_facets_operator_or".

Parameters

string $feature: The name of the optional feature.

Return value

boolean TRUE if this service knows and supports the specified feature. FALSE otherwise.

Overrides SearchApiAbstractService::supportsFeature

File

contrib/search_api_facetapi/example_service.php, line 34
Example implementation for a service class which supports facets.

Class

SearchApiFacetapiExampleService
Example class explaining how facets can be supported by a service class.

Code

public function supportsFeature($feature) {
  $supported = array(
    'search_api_facets' => TRUE,
    'search_api_facets_operator_or' => TRUE,
  );
  return isset($supported[$feature]);
}