PHP Class Smile\ElasticsuiteCatalog\Model\Autocomplete\Product\Attribute\DataProvider

Author: Aurelien FOUCRET ([email protected])
Inheritance: implements Magento\Search\Model\Autocomplete\DataProviderInterface
ファイルを表示 Open project: smile-sa/elasticsuite

Public Methods

Method Description
__construct ( ItemFactory $itemFactory, Collection $productCollection, Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $attributeCollectionFactory, Autocomplete $autocompleteHelper, Magento\Store\Model\StoreManagerInterface $storeManager, string $type = self::AUTOCOMPLETE_TYPE ) Constructor.
getItems ( ) {@inheritDoc}
getType ( ) : string Returns autocomplete type.

Private Methods

Method Description
getFilterField ( Magento\Catalog\Model\ResourceModel\Product\Attribute $attribute ) : string Get filter field for an attribute.
getResultsPageSize ( ) : integer Retrieve number of products to display in autocomplete results
loadAttributeCollection ( ) : DataProvider Load the attributes displayed in the suggest.
prepareProductCollection ( ) : DataProvider Append facets used to select suggested attributes.
resultSorterCallback ( Magento\Search\Model\Autocomplete\Item $item1, Magento\Search\Model\Autocomplete\Item $item2 ) : integer Sort autocomplete items by result count.

Method Details

__construct() public method

Constructor.
public __construct ( ItemFactory $itemFactory, Collection $productCollection, Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $attributeCollectionFactory, Autocomplete $autocompleteHelper, Magento\Store\Model\StoreManagerInterface $storeManager, string $type = self::AUTOCOMPLETE_TYPE )
$itemFactory ItemFactory Autocomplete item factory.
$productCollection Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection Autocomplete product collection.
$attributeCollectionFactory Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory Product attribute collection factory.
$autocompleteHelper Smile\ElasticsuiteCatalog\Helper\Autocomplete Autocomplete configuration helper.
$storeManager Magento\Store\Model\StoreManagerInterface Store manager.
$type string Autocomplete type code.

getItems() public method

{@inheritDoc}
public getItems ( )

getType() public method

Returns autocomplete type.
public getType ( ) : string
return string