protected function getSolrConnectionsByItem(Item $item)
    {
        $solrConnections = parent::getSolrConnectionsByItem($item);

        $page = $item->getRecord();
        // may use \TYPO3\CMS\Core\Utility\GeneralUtility::hideIfDefaultLanguage($page['l18n_cfg']) with TYPO3 4.6
        if ($page['l18n_cfg'] & 1) {
            // page is configured to hide the default translation -> remove Solr connection for default language
            unset($solrConnections[0]);
        }

        if (GeneralUtility::hideIfNotTranslated($page['l18n_cfg'])) {
            $accessibleSolrConnections = [];
            if (isset($solrConnections[0])) {
                $accessibleSolrConnections[0] = $solrConnections[0];
            }

            $translationOverlays = $this->pagesRepository->findTranslationOverlaysByPageId((int)$page['uid']);

            foreach ($translationOverlays as $overlay) {
                $languageId = $overlay['sys_language_uid'];
                if (array_key_exists($languageId, $solrConnections)) {
                    $accessibleSolrConnections[$languageId] = $solrConnections[$languageId];
                }
            }

            $solrConnections = $accessibleSolrConnections;
        }

        return $solrConnections;
    }
protected function getSolrConnectionsByItem(Item $item)
    {
        $solrConnections = parent::getSolrConnectionsByItem($item);

        $page = $item->getRecord();
        // may use \TYPO3\CMS\Core\Utility\GeneralUtility::hideIfDefaultLanguage($page['l18n_cfg']) with TYPO3 4.6
        if ($page['l18n_cfg'] & 1) {
            // page is configured to hide the default translation -> remove Solr connection for default language
            unset($solrConnections[0]);
        }

        if (GeneralUtility::hideIfNotTranslated($page['l18n_cfg'])) {
            $accessibleSolrConnections = [];
            if (isset($solrConnections[0])) {
                $accessibleSolrConnections[0] = $solrConnections[0];
            }

            $translationOverlays = $this->pagesRepository->findTranslationOverlaysByPageId((int)$page['uid']);

            foreach ($translationOverlays as $overlay) {
                $languageId = $overlay['sys_language_uid'];
                if (array_key_exists($languageId, $solrConnections)) {
                    $accessibleSolrConnections[$languageId] = $solrConnections[$languageId];
                }
            }

            $solrConnections = $accessibleSolrConnections;
        }

        return $solrConnections;
    }
protected function getSolrConnectionsByItem ( Item $ item ) { $ solrConnections = parent :: getSolrConnectionsByItem ( $ item ) ; $ page = $ item -> getRecord ( ) ; // may use \TYPO3\CMS\Core\Utility\GeneralUtility::hideIfDefaultLanguage($page['l18n_cfg']) with TYPO3 4.6 if ( $ page [ 'l18n_cfg' ] & 1 ) { // page is configured to hide the default translation -> remove Solr connection for default language unset ( $ solrConnections [ 0 ] ) ; } if ( GeneralUtility :: hideIfNotTranslated ( $ page [ 'l18n_cfg' ] ) ) { $ accessibleSolrConnections = [ ] ; if ( isset ( $ solrConnections [ 0 ] ) ) { $ accessibleSolrConnections [ 0 ] = $ solrConnections [ 0 ] ; } $ translationOverlays = $ this -> pagesRepository -> findTranslationOverlaysByPageId ( ( int ) $ page [ 'uid' ] ) ; foreach ( $ translationOverlays as $ overlay ) { $ languageId = $ overlay [ 'sys_language_uid' ] ; if ( array_key_exists ( $ languageId , $ solrConnections ) ) { $ accessibleSolrConnections [ $ languageId ] = $ solrConnections [ $ languageId ] ; } } $ solrConnections = $ accessibleSolrConnections ; } return $ solrConnections ; }
Gets the Solr connections applicable for a page.

The connections include the default connection and connections to be used
for translations of a page.

@param Item $item An index queue item
@return array An array of ApacheSolrForTypo3\Solr\System\Solr\SolrConnection connections, the array's keys are the sys_language_uid of the language of the connection
Gets the Solr connections applicable for a page .