PHP Class Smile\ElasticsuiteThesaurus\Model\ResourceModel\Thesaurus\Collection

Author: Romain Ruaud ([email protected])
Inheritance: extends Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
Show file Open project: smile-sa/elasticsuite

Public Methods

Method Description
__construct ( Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, Psr\Log\LoggerInterface $logger, Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, Magento\Framework\Event\ManagerInterface $eventManager, Magento\Store\Model\StoreManagerInterface $storeManager, Magento\Framework\DB\Helper $resourceHelper, Magento\Framework\DB\Adapter\AdapterInterface $connection = null, Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null )
addStoreFilter ( array | integer $storeIds ) Filter collection by specified store ids
getStoreId ( ) : integer | null Retrieve Store ID Filter
setStoreId ( Magento\Store\Model\Store | integer $store ) Set Store ID for filter
setTermFilter ( string $term ) Set thesaurus term to filter

Protected Methods

Method Description
_afterLoad ( ) Perform operations after collection load
_construct ( ) Init model for collection
_renderFiltersBefore ( ) Join store relation table if there is store filter

Private Methods

Method Description
addTermData ( array $termData ) Process terms of each thesaurus and display a summary for each thesaurus.
addTermFilterToSelect ( string $term ) Inject terms data on collection
loadStores ( ) : void Perform operations after collection load
loadTermsData ( ) : void Perform operations after collection load

Method Details

__construct() public method

public __construct ( Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, Psr\Log\LoggerInterface $logger, Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, Magento\Framework\Event\ManagerInterface $eventManager, Magento\Store\Model\StoreManagerInterface $storeManager, Magento\Framework\DB\Helper $resourceHelper, Magento\Framework\DB\Adapter\AdapterInterface $connection = null, Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null )
$entityFactory Magento\Framework\Data\Collection\EntityFactoryInterface Entity Factory
$logger Psr\Log\LoggerInterface Logger
$fetchStrategy Magento\Framework\Data\Collection\Db\FetchStrategyInterface Fetch Strategy
$eventManager Magento\Framework\Event\ManagerInterface Event Manager
$storeManager Magento\Store\Model\StoreManagerInterface Store Manager
$resourceHelper Magento\Framework\DB\Helper Resource Helper
$connection Magento\Framework\DB\Adapter\AdapterInterface Database Connection
$resource Magento\Framework\Model\ResourceModel\Db\AbstractDb Abstract Resource

_afterLoad() protected method

Perform operations after collection load
protected _afterLoad ( )

_construct() protected method

Init model for collection
protected _construct ( )

_renderFiltersBefore() protected method

Join store relation table if there is store filter
protected _renderFiltersBefore ( )

addStoreFilter() public method

Filter collection by specified store ids
public addStoreFilter ( array | integer $storeIds )
$storeIds array | integer The store ids to filter

getStoreId() public method

Retrieve Store ID Filter
public getStoreId ( ) : integer | null
return integer | null

setStoreId() public method

Set Store ID for filter
public setStoreId ( Magento\Store\Model\Store | integer $store )
$store Magento\Store\Model\Store | integer The store

setTermFilter() public method

Set thesaurus term to filter
public setTermFilter ( string $term )
$term string The term to filter