protected function getParsedSolrFieldsFromSchema($configuredFacets, $pageRecord)
    {
        $newItems = [];

        array_map(function($fieldName) use (&$newItems, $configuredFacets) {
            $value = $fieldName;
            $label = $fieldName;

            $facetNameFilter = function($facet) use ($fieldName) {
                return ($facet['field'] === $fieldName);
            };
            $configuredFacets = array_filter($configuredFacets, $facetNameFilter);
            if (!empty($configuredFacets)) {
                $configuredFacet = array_values($configuredFacets);
                $label = $configuredFacet[0]['label'];
                // try to translate LLL: label or leave it unchanged
                if (GeneralUtility::isFirstPartOfStr($label, 'LLL:') && $this->getTranslation($label) != '') {
                    $label = $this->getTranslation($label);
                } elseif (!GeneralUtility::isFirstPartOfStr($label, 'LLL:') && $configuredFacet[0]['label.']) {
                    $label = sprintf('cObject[...faceting.facets.%slabel]', array_keys($configuredFacets)[0]);
                }
                $label = sprintf('%s (Facet Label: "%s")', $value, $label);
            }

            $newItems[$value] = [$label, $value];
        }, $this->getFieldNamesFromSolrMetaDataForPage($pageRecord));

        ksort($newItems, SORT_NATURAL);
        return $newItems;
    }
protected function getParsedSolrFieldsFromSchema($configuredFacets, $pageRecord)
    {
        $newItems = [];

        array_map(function($fieldName) use (&$newItems, $configuredFacets) {
            $value = $fieldName;
            $label = $fieldName;

            $facetNameFilter = function($facet) use ($fieldName) {
                return ($facet['field'] === $fieldName);
            };
            $configuredFacets = array_filter($configuredFacets, $facetNameFilter);
            if (!empty($configuredFacets)) {
                $configuredFacet = array_values($configuredFacets);
                $label = $configuredFacet[0]['label'];
                // try to translate LLL: label or leave it unchanged
                if (GeneralUtility::isFirstPartOfStr($label, 'LLL:') && $this->getTranslation($label) != '') {
                    $label = $this->getTranslation($label);
                } elseif (!GeneralUtility::isFirstPartOfStr($label, 'LLL:') && $configuredFacet[0]['label.']) {
                    $label = sprintf('cObject[...faceting.facets.%slabel]', array_keys($configuredFacets)[0]);
                }
                $label = sprintf('%s (Facet Label: "%s")', $value, $label);
            }

            $newItems[$value] = [$label, $value];
        }, $this->getFieldNamesFromSolrMetaDataForPage($pageRecord));

        ksort($newItems, SORT_NATURAL);
        return $newItems;
    }
protected function getParsedSolrFieldsFromSchema ( $ configuredFacets , $ pageRecord ) { $ newItems = [ ] ; array_map ( function ( $ fieldName ) use ( & $ newItems , $ configuredFacets ) { $ value = $ fieldName ; $ label = $ fieldName ; $ facetNameFilter = function ( $ facet ) use ( $ fieldName ) { return ( $ facet [ 'field' ] === $ fieldName ) ; } ; $ configuredFacets = array_filter ( $ configuredFacets , $ facetNameFilter ) ; if ( ! empty ( $ configuredFacets ) ) { $ configuredFacet = array_values ( $ configuredFacets ) ; $ label = $ configuredFacet [ 0 ] [ 'label' ] ; // try to translate LLL: label or leave it unchanged if ( GeneralUtility :: isFirstPartOfStr ( $ label , 'LLL:' ) && $ this -> getTranslation ( $ label ) != '' ) { $ label = $ this -> getTranslation ( $ label ) ; } elseif ( ! GeneralUtility :: isFirstPartOfStr ( $ label , 'LLL:' ) && $ configuredFacet [ 0 ] [ 'label.' ] ) { $ label = sprintf ( 'cObject[...faceting.facets.%slabel]' , array_keys ( $ configuredFacets ) [ 0 ] ) ; } $ label = sprintf ( '%s (Facet Label: "%s")' , $ value , $ label ) ; } $ newItems [ $ value ] = [ $ label , $ value ] ; } , $ this -> getFieldNamesFromSolrMetaDataForPage ( $ pageRecord ) ) ; ksort ( $ newItems , SORT_NATURAL ) ; return $ newItems ; }
This method parses the solr schema fields into the required format for the backend flexform.

@param array $configuredFacets
@param array $pageRecord
@return mixed
This method parses the solr schema fields into the required format for the backend flexform .