eZ\Publish\Core\Search\Elasticsearch\Content\Extractor\Loading::extractHit PHP Method

extractHit() public method

public extractHit ( mixed $hit ) : eZ\Publish\API\Repository\Values\ValueObject
$hit mixed
return eZ\Publish\API\Repository\Values\ValueObject
    public function extractHit($hit)
    {
        if ($hit->_type === 'content') {
            return $this->contentHandler->loadContentInfo($hit->_id);
        }
        if ($hit->_type === 'location') {
            return $this->locationHandler->load($hit->_id);
        }
        throw new RuntimeException("Could not extract: document of type '{$hit->_type}' is not handled.");
    }