Log in
Model

Customer

Magento\Customer\Model\Customer

What it does

The Customer model class represents a customer entity in Magento 2 and provides methods for managing customer data, authentication, addresses, and account-related operations.

Developers use this class to load customer information, validate credentials, manage customer addresses, send account-related emails (registration, password reset), and perform customer-specific business logic throughout the application.

Public Methods

  • _construct()
  • getDataModel()
  • updateData()
  • getSharingConfig()
  • authenticate()
  • loadByEmail()
  • changePassword()
  • getName()
  • addAddress()
  • getAddressById()
  • getAddressItemById()
  • getAddressCollection()
  • getAddressesCollection()
  • getAddresses()
  • getAttributes()
  • getAttribute()
  • setPassword()
  • hashPassword()
  • validatePassword()
  • encryptPassword()
  • decryptPassword()
  • getPrimaryAddress()
  • getPrimaryBillingAddress()
  • getDefaultBillingAddress()
  • getPrimaryShippingAddress()
  • getDefaultShippingAddress()
  • getPrimaryAddressIds()
  • getPrimaryAddresses()
  • getAdditionalAddresses()
  • isAddressPrimary()
  • sendNewAccountEmail()
  • isConfirmationRequired()
  • getRandomConfirmationKey()
  • sendPasswordReminderEmail()
  • sendPasswordResetConfirmationEmail()
  • getGroupId()
  • getTaxClassId()
  • getStore()
  • getSharedStoreIds()
  • getSharedWebsiteIds()
  • getAttributeSetId()
  • setStore()
  • validate()
  • unsetSubscription()
  • cleanAllAddresses()
  • addError()
  • getErrors()
  • resetErrors()
  • afterSave()
  • afterDeleteCommit()
  • reindex()
  • getCreatedAtTimestamp()
  • reset()
  • isDeleteable()
  • setIsDeleteable()
  • isReadonly()
  • setIsReadonly()
  • getEntityType()
  • changeResetPasswordLinkToken()
  • isResetPasswordLinkTokenExpired()
  • getResetPasswordLinkExpirationPeriod()
  • isCustomerLocked()
  • getPasswordConfirm()
  • getPassword()
  • _resetState()