Log in
Model

Customer

Magento\Customer\Model\Customer

What it does

The Customer model represents a customer entity in Magento 2 and provides methods for managing customer data, authentication, addresses, and email notifications.

Developers use this class to load, save, and manipulate customer information, handle password operations, manage customer addresses, and send transactional emails like registration confirmations and password resets.

It serves as the main entry point for customer-related operations in custom modules and extensions.

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()