protected function getSelectedItemValues(AbstractFacet $facet, $facetNameToCheckRequirementsOn)
    {
        $facetToCheckRequirements = $facet->getResultSet()->getFacets()->getByName($facetNameToCheckRequirementsOn)->getByPosition(0);
        if (!$facetToCheckRequirements instanceof AbstractFacet) {
            throw new \InvalidArgumentException('Requirement for unexisting facet configured');
        }

        if (!$facetToCheckRequirements->getIsUsed()) {
            // unused facets do not have active values.
            return [];
        }

        $itemValues = [];
        $activeFacetItems = $facetToCheckRequirements->getAllFacetItems();
        foreach ($activeFacetItems as $item) {
            /** @var AbstractFacetItem $item */
            if ($item->getSelected()) {
                $itemValues[] = $item->getUriValue();
            }
        }

        return $itemValues;
    }
protected function getSelectedItemValues(AbstractFacet $facet, $facetNameToCheckRequirementsOn)
    {
        $facetToCheckRequirements = $facet->getResultSet()->getFacets()->getByName($facetNameToCheckRequirementsOn)->getByPosition(0);
        if (!$facetToCheckRequirements instanceof AbstractFacet) {
            throw new \InvalidArgumentException('Requirement for unexisting facet configured');
        }

        if (!$facetToCheckRequirements->getIsUsed()) {
            // unused facets do not have active values.
            return [];
        }

        $itemValues = [];
        $activeFacetItems = $facetToCheckRequirements->getAllFacetItems();
        foreach ($activeFacetItems as $item) {
            /** @var AbstractFacetItem $item */
            if ($item->getSelected()) {
                $itemValues[] = $item->getUriValue();
            }
        }

        return $itemValues;
    }
protected function getSelectedItemValues ( AbstractFacet $ facet , $ facetNameToCheckRequirementsOn ) { $ facetToCheckRequirements = $ facet -> getResultSet ( ) -> getFacets ( ) -> getByName ( $ facetNameToCheckRequirementsOn ) -> getByPosition ( 0 ) ; if ( ! $ facetToCheckRequirements instanceof AbstractFacet ) { throw new \ InvalidArgumentException ( 'Requirement for unexisting facet configured' ) ; } if ( ! $ facetToCheckRequirements -> getIsUsed ( ) ) { // unused facets do not have active values. return [ ] ; } $ itemValues = [ ] ; $ activeFacetItems = $ facetToCheckRequirements -> getAllFacetItems ( ) ; foreach ( $ activeFacetItems as $ item ) { /** @var AbstractFacetItem $item */ if ( $ item -> getSelected ( ) ) { $ itemValues [ ] = $ item -> getUriValue ( ) ; } } return $ itemValues ; }
Returns the active item values of a facet

@param string $facetNameToCheckRequirementsOn
@return AbstractFacetItem[]
Returns the active item values of a facet