/** * Constructor. * * @param Tx_Solr_Facet_Facet $facet The facet to render. */ public function __construct(Tx_Solr_Facet_Facet $facet) { $this->search = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Solr_Search'); $this->facet = $facet; $this->facetName = $facet->getName(); $this->solrConfiguration = Tx_Solr_Util::getSolrConfiguration(); $this->facetConfiguration = $this->solrConfiguration['search.']['faceting.']['facets.'][$this->facetName . '.']; $this->linkTargetPageId = $GLOBALS['TSFE']->id; $this->queryLinkBuilder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Solr_Query_LinkBuilder', $this->search->getQuery()); }
/** * Looks up a facet's configuration and creates a facet renderer accordingly. * * @param Tx_Solr_Facet_Facet $facet Facet * @return Tx_Solr_FacetRenderer Facet renderer as defined by the facet's configuration */ public function getFacetRendererByFacet($facet) { $facetRenderer = NULL; $facetConfiguration = $this->facetsConfiguration[$facet->getName() . '.']; $facetRendererClassName = $this->defaultFacetRendererClassName; if (isset($facetConfiguration['type'])) { $facetRendererClassName = $this->getFacetRendererClassNameByFacetType($facetConfiguration['type']); } $facetRenderer = GeneralUtility::makeInstance($facetRendererClassName, $facet); $this->validateObjectIsFacetRenderer($facetRenderer); return $facetRenderer; }
/** * Constructor. * * @param Tx_Solr_Facet_Facet $facet The facet to render. */ public function __construct(Tx_Solr_Facet_Facet $facet) { $this->search = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\Search'); $this->facet = $facet; $this->facetName = $facet->getName(); $this->solrConfiguration = Util::getSolrConfiguration(); $this->facetConfiguration = $this->solrConfiguration['search.']['faceting.']['facets.'][$this->facetName . '.']; $this->linkTargetPageId = $GLOBALS['TSFE']->id; $this->queryLinkBuilder = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\Query\\LinkBuilder', $this->search->getQuery()); }