Log in
Model

SwatchAttributeCodes

Magento\Swatches\Model\SwatchAttributeCodes

What it does

This class retrieves and caches a mapping of attribute IDs to attribute codes for all EAV attributes that have swatch options configured.

Developers would use this when they need to quickly identify which product attributes in the system are swatch-enabled (visual or text swatches) without repeatedly querying the database.

The class automatically handles caching to improve performance.

Public Methods

  • getCodes()