Log in
Model

GroupRegistry

Magento\Customer\Model\GroupRegistry

What it does

This class serves as a registry (cache) for Customer Group models in Magento 2.

It prevents redundant database queries by storing already-loaded customer groups in memory and retrieving them when needed again during the same request.

Developers use this when they need to access customer group data multiple times efficiently without repeatedly querying the database.

Public Methods

  • retrieve()
  • remove()
  • _resetState()