PHP Class Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Indexer\Fulltext\Datasource\CategoryData

Author: Aurelien FOUCRET ([email protected])
Inheritance: extends Smile\ElasticsuiteCatalog\Model\ResourceModel\Eav\Indexer\Indexer
Show file Open project: smile-sa/elasticsuite Class Usage Examples

Public Methods

Method Description
__construct ( Magento\Framework\App\ResourceConnection $resource, Magento\Store\Model\StoreManagerInterface $storeManager, Magento\Framework\EntityManager\MetadataPool $metadataPool, Magento\Eav\Model\Config $eavConfig ) CategoryData constructor.
loadCategoryData ( integer $storeId, array $productIds ) : array Load categories data for a list of product ids and a given store.

Protected Methods

Method Description
getCategoryNameAttribute ( ) : Magento\Eav\Model\Entity\Attribute\AbstractAttribute Returns category name attribute
getCategoryProductSelect ( array $productIds, integer $storeId ) : Zend_Db_Select Prepare indexed data select.
getEavConfig ( ) : Magento\Eav\Model\Config Access to EAV configuration.
getUseNameInSearchAttribute ( ) : Magento\Eav\Model\Entity\Attribute\AbstractAttribute Returns category "use name in product search" attribute

Private Methods

Method Description
loadCategoryNames ( array $categoryIds, integer $storeId ) : array Add some categories name into the cache of names of categories.
prepareCategoryNameSelect ( array $loadCategoryIds, integer $storeId ) : Magento\Framework\DB\Select Prepare SQL query to retrieve category names

Method Details

__construct() public method

CategoryData constructor.
public __construct ( Magento\Framework\App\ResourceConnection $resource, Magento\Store\Model\StoreManagerInterface $storeManager, Magento\Framework\EntityManager\MetadataPool $metadataPool, Magento\Eav\Model\Config $eavConfig )
$resource Magento\Framework\App\ResourceConnection Connection Resource
$storeManager Magento\Store\Model\StoreManagerInterface The store manager
$metadataPool Magento\Framework\EntityManager\MetadataPool Metadata Pool
$eavConfig Magento\Eav\Model\Config EAV Configuration

getCategoryNameAttribute() protected method

Returns category name attribute
protected getCategoryNameAttribute ( ) : Magento\Eav\Model\Entity\Attribute\AbstractAttribute
return Magento\Eav\Model\Entity\Attribute\AbstractAttribute

getCategoryProductSelect() protected method

Prepare indexed data select.
protected getCategoryProductSelect ( array $productIds, integer $storeId ) : Zend_Db_Select
$productIds array Product ids.
$storeId integer Store id.
return Zend_Db_Select

getEavConfig() protected method

Access to EAV configuration.
protected getEavConfig ( ) : Magento\Eav\Model\Config
return Magento\Eav\Model\Config

getUseNameInSearchAttribute() protected method

Returns category "use name in product search" attribute
protected getUseNameInSearchAttribute ( ) : Magento\Eav\Model\Entity\Attribute\AbstractAttribute
return Magento\Eav\Model\Entity\Attribute\AbstractAttribute

loadCategoryData() public method

Load categories data for a list of product ids and a given store.
public loadCategoryData ( integer $storeId, array $productIds ) : array
$storeId integer Store id.
$productIds array Product ids list.
return array