protected function getAdditionalDocuments(Document $pageDocument, array $existingDocuments)
    {
        $documents = $existingDocuments;

        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageAddDocuments'])) {
            return $documents;
        }

        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageAddDocuments'] as $classReference) {
            $additionalIndexer = GeneralUtility::makeInstance($classReference);

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

            $additionalDocuments = $additionalIndexer->getAdditionalPageDocuments($pageDocument, $documents);
            if (is_array($additionalDocuments)) {
                $documents = array_merge($documents, $additionalDocuments);
            }
        }

        return $documents;
    }
protected function getAdditionalDocuments(Document $pageDocument, array $existingDocuments)
    {
        $documents = $existingDocuments;

        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageAddDocuments'])) {
            return $documents;
        }

        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageAddDocuments'] as $classReference) {
            $additionalIndexer = GeneralUtility::makeInstance($classReference);

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

            $additionalDocuments = $additionalIndexer->getAdditionalPageDocuments($pageDocument, $documents);
            if (is_array($additionalDocuments)) {
                $documents = array_merge($documents, $additionalDocuments);
            }
        }

        return $documents;
    }
protected function getAdditionalDocuments ( Document $ pageDocument , array $ existingDocuments ) { $ documents = $ existingDocuments ; if ( ! is_array ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ 'Indexer' ] [ 'indexPageAddDocuments' ] ) ) { return $ documents ; } foreach ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ 'Indexer' ] [ 'indexPageAddDocuments' ] as $ classReference ) { $ additionalIndexer = GeneralUtility :: makeInstance ( $ classReference ) ; if ( ! $ additionalIndexer instanceof AdditionalPageIndexer ) { $ message = get_class ( $ additionalIndexer ) . ' must implement interface ' . AdditionalPageIndexer :: class ; throw new \ UnexpectedValueException ( $ message , 1310491024 ) ; } $ additionalDocuments = $ additionalIndexer -> getAdditionalPageDocuments ( $ pageDocument , $ documents ) ; if ( is_array ( $ additionalDocuments ) ) { $ documents = array_merge ( $ documents , $ additionalDocuments ) ; } } return $ documents ; }
Allows third party extensions to provide additional documents which
should be indexed for the current page.

@param Document $pageDocument The main document representing this page.
@param Document[] $existingDocuments An array of documents already created for this page.
@return array An array of additional Document objects to index
Allows third party extensions to provide additional documents which should be indexed for the current page .