PHP Class Smile\ElasticsuiteCatalog\Model\ResourceModel\Category\Fulltext\Collection

Basically a copy-pasted version of @see Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection
Author: Romain Ruaud ([email protected])
Inheritance: extends Magento\Catalog\Model\ResourceModel\Category\Collection
Show file Open project: smile-sa/elasticsuite

Public Methods

Method Description
__construct ( Magento\Framework\Data\Collection\EntityFactory $entityFactory, Psr\Log\LoggerInterface $logger, Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, Magento\Framework\Event\ManagerInterface $eventManager, Magento\Eav\Model\Config $eavConfig, Magento\Framework\App\ResourceConnection $resource, Magento\Eav\Model\EntityFactory $eavEntityFactory, Magento\Eav\Model\ResourceModel\Helper $resourceHelper, Magento\Framework\Validator\UniversalFactory $universalFactory, Magento\Store\Model\StoreManagerInterface $storeManager, Smile\ElasticsuiteCore\Search\Request\Builder $requestBuilder, Magento\Search\Model\SearchEngine $searchEngine, Magento\Framework\DB\Adapter\AdapterInterface $connection = null, string $searchRequestName = 'category_search_container' ) Collection constructor.
addAttributeToSort ( $attribute, $dir = self::SORT_ORDER_ASC ) {@inheritDoc}
addFacet ( string $field, string $facetType, array $facetConfig, array $facetFilter = null ) : Collection Append a facet to the collection
addFieldToFilter ( $field, $condition = null ) {@inheritDoc}
addQueryFilter ( Smile\ElasticsuiteCore\Search\Request\QueryInterface $queryFilter ) Append a prebuilt (QueryInterface) query filter to the collection.
addSearchFilter ( string $query ) : Collection Add search query filter
getFacetedData ( string $field ) : array Return field faceted data from faceted search result.
getSize ( ) {@inheritDoc}
isSpellchecked ( ) : boolean Indicates if the collection is spellchecked or not.
setOrder ( $attribute, $dir = self::SORT_ORDER_DESC ) {@inheritDoc}

Protected Methods

Method Description
_afterLoad ( )
_renderFiltersBefore ( )

Private Methods

Method Description
loadItemCounts ( ) : void Load items count : - collection size
prepareRequest ( ) : Smile\ElasticsuiteCore\Search\RequestInterface Prepare the search request before it will be executed.
prepareSortOrders ( ) : array() Prepare sort orders for the request builder.

Method Details

__construct() public method

Collection constructor.
public __construct ( Magento\Framework\Data\Collection\EntityFactory $entityFactory, Psr\Log\LoggerInterface $logger, Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, Magento\Framework\Event\ManagerInterface $eventManager, Magento\Eav\Model\Config $eavConfig, Magento\Framework\App\ResourceConnection $resource, Magento\Eav\Model\EntityFactory $eavEntityFactory, Magento\Eav\Model\ResourceModel\Helper $resourceHelper, Magento\Framework\Validator\UniversalFactory $universalFactory, Magento\Store\Model\StoreManagerInterface $storeManager, Smile\ElasticsuiteCore\Search\Request\Builder $requestBuilder, Magento\Search\Model\SearchEngine $searchEngine, Magento\Framework\DB\Adapter\AdapterInterface $connection = null, string $searchRequestName = 'category_search_container' )
$entityFactory Magento\Framework\Data\Collection\EntityFactory The Entity Factory
$logger Psr\Log\LoggerInterface The Logger
$fetchStrategy Magento\Framework\Data\Collection\Db\FetchStrategyInterface Fetch Strategy
$eventManager Magento\Framework\Event\ManagerInterface Event Manager
$eavConfig Magento\Eav\Model\Config EAV Configuration
$resource Magento\Framework\App\ResourceConnection Resource Connection
$eavEntityFactory Magento\Eav\Model\EntityFactory Entity Factory
$resourceHelper Magento\Eav\Model\ResourceModel\Helper Resource Helper
$universalFactory Magento\Framework\Validator\UniversalFactory Universal Factory
$storeManager Magento\Store\Model\StoreManagerInterface Store Manager
$requestBuilder Smile\ElasticsuiteCore\Search\Request\Builder Search request builder.
$searchEngine Magento\Search\Model\SearchEngine Search engine
$connection Magento\Framework\DB\Adapter\AdapterInterface Db Connection.
$searchRequestName string Search request name.

_afterLoad() protected method

protected _afterLoad ( )

_renderFiltersBefore() protected method

protected _renderFiltersBefore ( )

addAttributeToSort() public method

{@inheritDoc}
public addAttributeToSort ( $attribute, $dir = self::SORT_ORDER_ASC )

addFacet() public method

Append a facet to the collection
public addFacet ( string $field, string $facetType, array $facetConfig, array $facetFilter = null ) : Collection
$field string Facet field.
$facetType string Facet type.
$facetConfig array Facet config params.
$facetFilter array Facet filter.
return Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection

addFieldToFilter() public method

{@inheritDoc}
public addFieldToFilter ( $field, $condition = null )

addQueryFilter() public method

Append a prebuilt (QueryInterface) query filter to the collection.
public addQueryFilter ( Smile\ElasticsuiteCore\Search\Request\QueryInterface $queryFilter )
$queryFilter Smile\ElasticsuiteCore\Search\Request\QueryInterface Query filter.

addSearchFilter() public method

Add search query filter
public addSearchFilter ( string $query ) : Collection
$query string Search query text.
return Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection

getFacetedData() public method

Return field faceted data from faceted search result.
public getFacetedData ( string $field ) : array
$field string Facet field.
return array

getSize() public method

{@inheritDoc}
public getSize ( )

isSpellchecked() public method

Indicates if the collection is spellchecked or not.
public isSpellchecked ( ) : boolean
return boolean

setOrder() public method

{@inheritDoc}
public setOrder ( $attribute, $dir = self::SORT_ORDER_DESC )