Log in
Model

CustomerRegistry

Magento\Customer\Model\CustomerRegistry

What it does

This class acts as an in-memory cache/registry for Customer models to avoid repeated database queries.

Developers use it to retrieve customer objects by ID or email efficiently, as it stores already-loaded customers and returns them from memory on subsequent requests.

It also manages secure customer data separately and provides methods to clear cached instances when customer data changes.

Public Methods

  • retrieve()
  • retrieveByEmail()
  • retrieveSecureData()
  • remove()
  • removeByEmail()
  • push()
  • _resetState()