protected function buildVariantDocumentAndAssignToParentResult(ResponseAdapter $response, $variantAccessKey, SearchResult $resultDocument)
    {
        foreach ($response->{'expanded'}->{$variantAccessKey}->{'docs'} as $variantDocumentArray) {
            $fields = get_object_vars($variantDocumentArray);
            $variantDocument = new SearchResult($fields);

            $variantSearchResult = $this->resultBuilder->fromApacheSolrDocument($variantDocument);
            $variantSearchResult->setIsVariant(true);
            $variantSearchResult->setVariantParent($resultDocument);

            $resultDocument->addVariant($variantSearchResult);
        }
    }
protected function buildVariantDocumentAndAssignToParentResult(ResponseAdapter $response, $variantAccessKey, SearchResult $resultDocument)
    {
        foreach ($response->{'expanded'}->{$variantAccessKey}->{'docs'} as $variantDocumentArray) {
            $fields = get_object_vars($variantDocumentArray);
            $variantDocument = new SearchResult($fields);

            $variantSearchResult = $this->resultBuilder->fromApacheSolrDocument($variantDocument);
            $variantSearchResult->setIsVariant(true);
            $variantSearchResult->setVariantParent($resultDocument);

            $resultDocument->addVariant($variantSearchResult);
        }
    }
protected function buildVariantDocumentAndAssignToParentResult ( ResponseAdapter $ response , $ variantAccessKey , SearchResult $ resultDocument ) { foreach ( $ response -> { 'expanded' } -> { $ variantAccessKey } -> { 'docs' } as $ variantDocumentArray ) { $ fields = get_object_vars ( $ variantDocumentArray ) ; $ variantDocument = new SearchResult ( $ fields ) ; $ variantSearchResult = $ this -> resultBuilder -> fromApacheSolrDocument ( $ variantDocument ) ; $ variantSearchResult -> setIsVariant ( true ) ; $ variantSearchResult -> setVariantParent ( $ resultDocument ) ; $ resultDocument -> addVariant ( $ variantSearchResult ) ; } }
Build the SearchResult of the variant and assigns it to the parent result document.

@param ResponseAdapter $response
@param string $variantAccessKey
@param SearchResult $resultDocument
Build the SearchResult of the variant and assigns it to the parent result document .