public function HideActiveItemsProcessor::build in Facets 8
Runs before the renderable array is created.
Parameters
\Drupal\facets\FacetInterface $facet: The facet being changed.
\Drupal\facets\Result\ResultInterface[] $results: The results being changed.
Return value
\Drupal\facets\Result\ResultInterface[] The changed results.
Overrides BuildProcessorInterface::build
File
- src/
Plugin/ facets/ processor/ HideActiveItemsProcessor.php, line 26
Class
- HideActiveItemsProcessor
- Provides a processor that hides results that don't narrow results.
Namespace
Drupal\facets\Plugin\facets\processorCode
public function build(FacetInterface $facet, array $results) {
/** @var \Drupal\facets\Result\ResultInterface $result */
foreach ($results as $id => $result) {
if ($result
->isActive()) {
unset($results[$id]);
}
}
return $results;
}