/** * Init attributes used into ES. * * @return \Smile\ElasticsuiteCatalog\Model\Eav\Indexer\Fulltext\Datasource\AbstractAttributeData */ private function initAttributes() { $attributeCollection = $this->attributeHelper->getAttributeCollection(); $this->resourceModel->addIndexedFilterToAttributeCollection($attributeCollection); foreach ($attributeCollection as $attribute) { if ($this->canIndexAttribute($attribute)) { $attributeId = (int) $attribute->getId(); $this->attributesById[$attributeId] = $attribute; $this->attributeIdsByTable[$attribute->getBackendTable()][] = $attributeId; $this->initField($attribute); } } return $this; }
/** * Constructor. * * @param ResourceConnection $resource Database adpater. * @param StoreManagerInterface $storeManager Store manager. * @param MetadataPool $metadataPool Metadata Pool. * @param ProductType $catalogProductType Product type. * @param string $entityType Product entity type. */ public function __construct(ResourceConnection $resource, StoreManagerInterface $storeManager, MetadataPool $metadataPool, ProductType $catalogProductType, $entityType = ProductInterface::class) { parent::__construct($resource, $storeManager, $metadataPool, $entityType); $this->catalogProductType = $catalogProductType; }