* @author Timo Hund */ class RemoveFacetViewHelper extends AbstractUriViewHelper { /** * Initializes the arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('facet', AbstractFacet::class, 'The facet', true); } /** * @param array $arguments * @param \Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return string * @throws \InvalidArgumentException */ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { /** @var $facet AbstractFacet */ $facet = $arguments['facet']; $previousRequest = $facet->getResultSet()->getUsedSearchRequest(); $uri = self::getSearchUriBuilder($renderingContext)->getRemoveFacetUri($previousRequest, $facet->getName()); return $uri; } }