Log in
Model

GroupRegistry

Magento\Customer\Model\GroupRegistry

What it does

The GroupRegistry acts as a centralized cache for Customer Group models in Magento 2.

It prevents repeated database queries by storing already-loaded customer groups in memory, allowing developers to retrieve the same group instance multiple times efficiently.

Use this when you need to access customer group data frequently within a single request cycle.

Public Methods

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