private function getUnsortedProductData()
    {
        $productCollection = $this->getProductCollection()->setPageSize($this->size);

        if (!in_array($this->search, [null, ''])) {
            $productCollection->setSearchQuery($this->search);
        }

        return ['products' => $productCollection->getItems(), 'size' => $productCollection->getSize()];
    }
private function getUnsortedProductData()
    {
        $productCollection = $this->getProductCollection()->setPageSize($this->size);

        if (!in_array($this->search, [null, ''])) {
            $productCollection->setSearchQuery($this->search);
        }

        return ['products' => $productCollection->getItems(), 'size' => $productCollection->getSize()];
    }
private function getUnsortedProductData ( ) { $ productCollection = $ this -> getProductCollection ( ) -> setPageSize ( $ this -> size ) ; if ( ! in_array ( $ this -> search , [ null , '' ] ) ) { $ productCollection -> setSearchQuery ( $ this -> search ) ; } return [ 'products' => $ productCollection -> getItems ( ) , 'size' => $ productCollection -> getSize ( ) ] ; }
Return a collection with with products that match the current preview.

@return array
Return a collection with with products that match the current preview .