Smile\ElasticsuiteCatalog\Helper\Attribute::getAttributeCollection PHP Method

getAttributeCollection() public method

Retrieve a new product attribute collection.
public getAttributeCollection ( ) : Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection
return Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection
    public function getAttributeCollection()
    {
        return $this->attributeCollectionFactory->create();
    }

Usage Example

 /**
  * 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;
 }