Layer
Magento\Catalog\Model\Layer
What it does
The Layer class manages product collections and filtering for catalog browsing in Magento 2.
Developers use this when working with category pages, layered navigation, and product filtering to access the current category, retrieve filtered product collections, and manage the state of applied filters.
It acts as a central point for coordinating product display with category context and filter application.
Public Methods
- getStateKey()
- getProductCollection()
- prepareProductCollection()
- apply()
- getCurrentCategory()
- setCurrentCategory()
- getCurrentStore()
- getState()
- _resetState()