public function fromApacheSolrDocument(Document $originalDocument)
    {

        $searchResultClassName = $this->getResultClassName();
        $result = GeneralUtility::makeInstance($searchResultClassName, /** @scrutinizer ignore-type */ $originalDocument->getFields() ?? []);

        if (!$result instanceof SearchResult) {
            throw new \InvalidArgumentException('Could not create result object with class: ' . (string)$searchResultClassName, 1470037679);
        }

        return $result;
    }
public function fromApacheSolrDocument(Document $originalDocument)
    {

        $searchResultClassName = $this->getResultClassName();
        $result = GeneralUtility::makeInstance($searchResultClassName, /** @scrutinizer ignore-type */ $originalDocument->getFields() ?? []);

        if (!$result instanceof SearchResult) {
            throw new \InvalidArgumentException('Could not create result object with class: ' . (string)$searchResultClassName, 1470037679);
        }

        return $result;
    }
public function fromApacheSolrDocument ( Document $ originalDocument ) { $ searchResultClassName = $ this -> getResultClassName ( ) ; $ result = GeneralUtility :: makeInstance ( $ searchResultClassName , /** @scrutinizer ignore-type */ $ originalDocument -> getFields ( ) ?? [ ] ) ; if ( ! $ result instanceof SearchResult ) { throw new \ InvalidArgumentException ( 'Could not create result object with class: ' . ( string ) $ searchResultClassName , 1470037679 ) ; } return $ result ; }
This method is used to wrap the original solr document instance in an instance of the configured SearchResult
class.

@param Document $originalDocument
@throws \InvalidArgumentException
@return SearchResult
This method is used to wrap the original solr document instance in an instance of the configured SearchResult class .