Log in
Model

CustomerIdProvider

Magento\Customer\Model\CustomerIdProvider

What it does

This class provides a simple way to retrieve the customer ID from the current HTTP request.

Developers use it when they need to get the customer ID from request parameters in a consistent, type-safe manner across the application.

It's particularly useful in controllers, observers, or services that handle customer-related operations where the customer ID is passed as a request parameter.

Public Methods

  • getCustomerId()