getAttributeCollection() public method

Retrieve attribute collection prefiltered with only attribute usable in rules.
public getAttributeCollection ( ) : Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection
return Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection
Example #1
0
 /**
  * {@inheritDoc}
  */
 public function loadAttributeOptions()
 {
     $productAttributes = $this->attributeList->getAttributeCollection();
     $attributes = [];
     foreach ($productAttributes as $attribute) {
         $attributes[$attribute->getAttributeCode()] = $attribute->getFrontendLabel();
     }
     $this->_addSpecialAttributes($attributes);
     asort($attributes);
     $this->setAttributeOption($attributes);
     return $this;
 }