You are here

public function CustomWidget::supportsFacet in Facets 8

Checks if the facet is supported by this processor.

Reasons why this would be unsupported can be chosen by the processor.

Parameters

\Drupal\facets\FacetInterface $facet: The facet to check for.

Return value

bool Returns true when allowed, false otherwise.

Overrides WidgetPluginBase::supportsFacet

See also

\Drupal\facets\Processor\ProcessorInterface::supportsFacet

File

tests/facets_custom_widget/src/Plugin/facets/widget/CustomWidget.php, line 36

Class

CustomWidget
A simple widget class that returns a simple array of the facet results.

Namespace

Drupal\facets_custom_widget\Plugin\facets\widget

Code

public function supportsFacet(FacetInterface $facet) {
  return \Drupal::state()
    ->get('facets_test_supports_facet', TRUE);
}