protected function substitutePageDocument(Document $pageDocument)
    {
        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageSubstitutePageDocument'])) {
            return $pageDocument;
        }

        $indexConfigurationName = $this->getIndexConfigurationNameForCurrentPage();
        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageSubstitutePageDocument'] as $classReference) {
            $substituteIndexer = GeneralUtility::makeInstance($classReference);

            if (!$substituteIndexer instanceof SubstitutePageIndexer) {
                $message = get_class($substituteIndexer) . ' must implement interface ' . SubstitutePageIndexer::class;
                throw new \UnexpectedValueException($message, 1310491001);
            }

            if ($substituteIndexer instanceof PageFieldMappingIndexer) {
                $substituteIndexer->setPageIndexingConfigurationName($indexConfigurationName);
            }

            $substituteDocument = $substituteIndexer->getPageDocument($pageDocument);
            if (!$substituteDocument instanceof Document) {
                $message = 'The document returned by ' . get_class($substituteIndexer) . ' is not a valid Document object.';
                throw new \UnexpectedValueException($message, 1310490952);
            }
            $pageDocument = $substituteDocument;
        }

        return $pageDocument;
    }
protected function substitutePageDocument(Document $pageDocument)
    {
        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageSubstitutePageDocument'])) {
            return $pageDocument;
        }

        $indexConfigurationName = $this->getIndexConfigurationNameForCurrentPage();
        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageSubstitutePageDocument'] as $classReference) {
            $substituteIndexer = GeneralUtility::makeInstance($classReference);

            if (!$substituteIndexer instanceof SubstitutePageIndexer) {
                $message = get_class($substituteIndexer) . ' must implement interface ' . SubstitutePageIndexer::class;
                throw new \UnexpectedValueException($message, 1310491001);
            }

            if ($substituteIndexer instanceof PageFieldMappingIndexer) {
                $substituteIndexer->setPageIndexingConfigurationName($indexConfigurationName);
            }

            $substituteDocument = $substituteIndexer->getPageDocument($pageDocument);
            if (!$substituteDocument instanceof Document) {
                $message = 'The document returned by ' . get_class($substituteIndexer) . ' is not a valid Document object.';
                throw new \UnexpectedValueException($message, 1310490952);
            }
            $pageDocument = $substituteDocument;
        }

        return $pageDocument;
    }
protected function substitutePageDocument ( Document $ pageDocument ) { if ( ! is_array ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ 'Indexer' ] [ 'indexPageSubstitutePageDocument' ] ) ) { return $ pageDocument ; } $ indexConfigurationName = $ this -> getIndexConfigurationNameForCurrentPage ( ) ; foreach ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ 'Indexer' ] [ 'indexPageSubstitutePageDocument' ] as $ classReference ) { $ substituteIndexer = GeneralUtility :: makeInstance ( $ classReference ) ; if ( ! $ substituteIndexer instanceof SubstitutePageIndexer ) { $ message = get_class ( $ substituteIndexer ) . ' must implement interface ' . SubstitutePageIndexer :: class ; throw new \ UnexpectedValueException ( $ message , 1310491001 ) ; } if ( $ substituteIndexer instanceof PageFieldMappingIndexer ) { $ substituteIndexer -> setPageIndexingConfigurationName ( $ indexConfigurationName ) ; } $ substituteDocument = $ substituteIndexer -> getPageDocument ( $ pageDocument ) ; if ( ! $ substituteDocument instanceof Document ) { $ message = 'The document returned by ' . get_class ( $ substituteIndexer ) . ' is not a valid Document object.' ; throw new \ UnexpectedValueException ( $ message , 1310490952 ) ; } $ pageDocument = $ substituteDocument ; } return $ pageDocument ; }
Allows third party extensions to replace or modify the page document
created by this indexer.

@param Document $pageDocument The page document created by this indexer.
@return Document An Apache Solr document representing the currently indexed page
Allows third party extensions to replace or modify the page document created by this indexer .