protected function resolveFieldValue(
        array $indexingConfiguration,
        $solrFieldName,
        array $data
    ) {
        $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class);

        if (isset($indexingConfiguration[$solrFieldName . '.'])) {
            // configuration found => need to resolve a cObj

            // need to change directory to make IMAGE content objects work in BE context
            // see http://blog.netzelf.de/lang/de/tipps-und-tricks/tslib_cobj-image-im-backend
            $backupWorkingDirectory = getcwd();
            chdir(PATH_site);

            $contentObject->start($data, $this->type);
            $fieldValue = $contentObject->cObjGetSingle(
                $indexingConfiguration[$solrFieldName],
                $indexingConfiguration[$solrFieldName . '.']
            );

            chdir($backupWorkingDirectory);

            if ($this->isSerializedValue($indexingConfiguration,
                $solrFieldName)
            ) {
                $fieldValue = unserialize($fieldValue);
            }
        } elseif (substr($indexingConfiguration[$solrFieldName], 0,
                1) === '<'
        ) {
            $referencedTsPath = trim(substr($indexingConfiguration[$solrFieldName],
                1));
            $typoScriptParser = GeneralUtility::makeInstance(TypoScriptParser::class);
            // $name and $conf is loaded with the referenced values.
            list($name, $conf) = $typoScriptParser->getVal($referencedTsPath,
                $GLOBALS['TSFE']->tmpl->setup);

            // need to change directory to make IMAGE content objects work in BE context
            // see http://blog.netzelf.de/lang/de/tipps-und-tricks/tslib_cobj-image-im-backend
            $backupWorkingDirectory = getcwd();
            chdir(PATH_site);

            $contentObject->start($data, $this->type);
            $fieldValue = $contentObject->cObjGetSingle($name, $conf);

            chdir($backupWorkingDirectory);

            if ($this->isSerializedValue($indexingConfiguration,
                $solrFieldName)
            ) {
                $fieldValue = unserialize($fieldValue);
            }
        } else {
            $fieldValue = $data[$indexingConfiguration[$solrFieldName]];
        }

        // detect and correct type for dynamic fields

        // find last underscore, substr from there, cut off last character (S/M)
        $fieldType = substr($solrFieldName, strrpos($solrFieldName, '_') + 1,
            -1);
        if (is_array($fieldValue)) {
            foreach ($fieldValue as $key => $value) {
                $fieldValue[$key] = $this->ensureFieldValueType($value,
                    $fieldType);
            }
        } else {
            $fieldValue = $this->ensureFieldValueType($fieldValue, $fieldType);
        }

        return $fieldValue;
    }
protected function resolveFieldValue(
        array $indexingConfiguration,
        $solrFieldName,
        array $data
    ) {
        $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class);

        if (isset($indexingConfiguration[$solrFieldName . '.'])) {
            // configuration found => need to resolve a cObj

            // need to change directory to make IMAGE content objects work in BE context
            // see http://blog.netzelf.de/lang/de/tipps-und-tricks/tslib_cobj-image-im-backend
            $backupWorkingDirectory = getcwd();
            chdir(PATH_site);

            $contentObject->start($data, $this->type);
            $fieldValue = $contentObject->cObjGetSingle(
                $indexingConfiguration[$solrFieldName],
                $indexingConfiguration[$solrFieldName . '.']
            );

            chdir($backupWorkingDirectory);

            if ($this->isSerializedValue($indexingConfiguration,
                $solrFieldName)
            ) {
                $fieldValue = unserialize($fieldValue);
            }
        } elseif (substr($indexingConfiguration[$solrFieldName], 0,
                1) === '<'
        ) {
            $referencedTsPath = trim(substr($indexingConfiguration[$solrFieldName],
                1));
            $typoScriptParser = GeneralUtility::makeInstance(TypoScriptParser::class);
            // $name and $conf is loaded with the referenced values.
            list($name, $conf) = $typoScriptParser->getVal($referencedTsPath,
                $GLOBALS['TSFE']->tmpl->setup);

            // need to change directory to make IMAGE content objects work in BE context
            // see http://blog.netzelf.de/lang/de/tipps-und-tricks/tslib_cobj-image-im-backend
            $backupWorkingDirectory = getcwd();
            chdir(PATH_site);

            $contentObject->start($data, $this->type);
            $fieldValue = $contentObject->cObjGetSingle($name, $conf);

            chdir($backupWorkingDirectory);

            if ($this->isSerializedValue($indexingConfiguration,
                $solrFieldName)
            ) {
                $fieldValue = unserialize($fieldValue);
            }
        } else {
            $fieldValue = $data[$indexingConfiguration[$solrFieldName]];
        }

        // detect and correct type for dynamic fields

        // find last underscore, substr from there, cut off last character (S/M)
        $fieldType = substr($solrFieldName, strrpos($solrFieldName, '_') + 1,
            -1);
        if (is_array($fieldValue)) {
            foreach ($fieldValue as $key => $value) {
                $fieldValue[$key] = $this->ensureFieldValueType($value,
                    $fieldType);
            }
        } else {
            $fieldValue = $this->ensureFieldValueType($fieldValue, $fieldType);
        }

        return $fieldValue;
    }
protected function resolveFieldValue ( array $ indexingConfiguration , $ solrFieldName , array $ data ) { $ contentObject = GeneralUtility :: makeInstance ( ContentObjectRenderer :: class ) ; if ( isset ( $ indexingConfiguration [ $ solrFieldName . '.' ] ) ) { // configuration found => need to resolve a cObj // need to change directory to make IMAGE content objects work in BE context // see http://blog.netzelf.de/lang/de/tipps-und-tricks/tslib_cobj-image-im-backend $ backupWorkingDirectory = getcwd ( ) ; chdir ( PATH_site ) ; $ contentObject -> start ( $ data , $ this -> type ) ; $ fieldValue = $ contentObject -> cObjGetSingle ( $ indexingConfiguration [ $ solrFieldName ] , $ indexingConfiguration [ $ solrFieldName . '.' ] ) ; chdir ( $ backupWorkingDirectory ) ; if ( $ this -> isSerializedValue ( $ indexingConfiguration , $ solrFieldName ) ) { $ fieldValue = unserialize ( $ fieldValue ) ; } } elseif ( substr ( $ indexingConfiguration [ $ solrFieldName ] , 0 , 1 ) === '<' ) { $ referencedTsPath = trim ( substr ( $ indexingConfiguration [ $ solrFieldName ] , 1 ) ) ; $ typoScriptParser = GeneralUtility :: makeInstance ( TypoScriptParser :: class ) ; // $name and $conf is loaded with the referenced values. list ( $ name , $ conf ) = $ typoScriptParser -> getVal ( $ referencedTsPath , $ GLOBALS [ 'TSFE' ] -> tmpl -> setup ) ; // need to change directory to make IMAGE content objects work in BE context // see http://blog.netzelf.de/lang/de/tipps-und-tricks/tslib_cobj-image-im-backend $ backupWorkingDirectory = getcwd ( ) ; chdir ( PATH_site ) ; $ contentObject -> start ( $ data , $ this -> type ) ; $ fieldValue = $ contentObject -> cObjGetSingle ( $ name , $ conf ) ; chdir ( $ backupWorkingDirectory ) ; if ( $ this -> isSerializedValue ( $ indexingConfiguration , $ solrFieldName ) ) { $ fieldValue = unserialize ( $ fieldValue ) ; } } else { $ fieldValue = $ data [ $ indexingConfiguration [ $ solrFieldName ] ] ; } // detect and correct type for dynamic fields // find last underscore, substr from there, cut off last character (S/M) $ fieldType = substr ( $ solrFieldName , strrpos ( $ solrFieldName , '_' ) + 1 , - 1 ) ; if ( is_array ( $ fieldValue ) ) { foreach ( $ fieldValue as $ key => $ value ) { $ fieldValue [ $ key ] = $ this -> ensureFieldValueType ( $ value , $ fieldType ) ; } } else { $ fieldValue = $ this -> ensureFieldValueType ( $ fieldValue , $ fieldType ) ; } return $ fieldValue ; }
Resolves a field to its value depending on its configuration.

This enables you to configure the indexer to put the item/record through
cObj processing if wanted/needed. Otherwise the plain item/record value
is taken.

@param array $indexingConfiguration Indexing configuration as defined in plugin.tx_solr_index.queue.[indexingConfigurationName].fields
@param string $solrFieldName A Solr field name that is configured in the indexing configuration
@param array $data A record or item's data
@return string The resolved string value to be indexed
Resolves a field to its value depending on its configuration .