/** * @param \Magento\Catalog\Model\Resource\Eav\Attribute $subject * @param \Magento\Catalog\Model\Resource\Eav\Attribute $attribute * @return \Magento\Catalog\Model\Resource\Eav\Attribute * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterSave(\Magento\Catalog\Model\Resource\Eav\Attribute $subject, \Magento\Catalog\Model\Resource\Eav\Attribute $attribute) { if ($attribute->dataHasChangedFor('is_used_for_promo_rules') && !$attribute->getIsUsedForPromoRules()) { $this->checkCatalogRulesAvailability($attribute->getAttributeCode()); } return $attribute; }