Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
createAccount (\Magento\Customer\Api\Data\CustomerInterface $customer, $password=null, $redirectUrl='') | |
createAccountWithPasswordHash (\Magento\Customer\Api\Data\CustomerInterface $customer, $hash, $redirectUrl='') | |
validate (\Magento\Customer\Api\Data\CustomerInterface $customer) | |
isReadonly ($customerId) | |
activate ($email, $confirmationKey) | |
activateById ($customerId, $confirmationKey) | |
authenticate ($email, $password) | |
changePassword ($email, $currentPassword, $newPassword) | |
changePasswordById ($customerId, $currentPassword, $newPassword) | |
initiatePasswordReset ($email, $template, $websiteId=null) | |
resetPassword ($email, $resetToken, $newPassword) | |
validateResetPasswordLinkToken ($customerId, $resetPasswordLinkToken) | |
getConfirmationStatus ($customerId) | |
resendConfirmation ($email, $websiteId, $redirectUrl='') | |
isEmailAvailable ($customerEmail, $websiteId=null) | |
isCustomerInStore ($customerWebsiteId, $storeId) | |
getDefaultBillingAddress ($customerId) | |
getDefaultShippingAddress ($customerId) | |
getPasswordHash ($password) | |
Data Fields | |
const | ACCOUNT_CONFIRMED = 'account_confirmed' |
const | ACCOUNT_CONFIRMATION_REQUIRED = 'account_confirmation_required' |
const | ACCOUNT_CONFIRMATION_NOT_REQUIRED = 'account_confirmation_not_required' |
const | MAX_PASSWORD_LENGTH = 256 |
Interface for managing customers accounts. @api
Definition at line 17 of file AccountManagementInterface.php.
activate | ( | $email, | |
$confirmationKey | |||
) |
Activate a customer account using a key that was sent in a confirmation email.
string | ||
string | $confirmationKey |
Implemented in AccountManagement.
activateById | ( | $customerId, | |
$confirmationKey | |||
) |
Activate a customer account using a key that was sent in a confirmation email.
@api
int | $customerId | |
string | $confirmationKey |
Implemented in AccountManagement.
authenticate | ( | $email, | |
$password | |||
) |
Authenticate a customer by username and password
string | ||
string | $password |
Implemented in AccountManagement.
changePassword | ( | $email, | |
$currentPassword, | |||
$newPassword | |||
) |
Change customer password.
string | ||
string | $currentPassword | |
string | $newPassword |
Implemented in AccountManagement.
changePasswordById | ( | $customerId, | |
$currentPassword, | |||
$newPassword | |||
) |
Change customer password.
int | $customerId | |
string | $currentPassword | |
string | $newPassword |
Implemented in AccountManagement.
createAccount | ( | \Magento\Customer\Api\Data\CustomerInterface | $customer, |
$password = null , |
|||
$redirectUrl = '' |
|||
) |
#- Create customer account. Perform necessary business operations like sending email.
\Magento\Customer\Api\Data\CustomerInterface | $customer | |
string | $password | |
string | $redirectUrl |
createAccountWithPasswordHash | ( | \Magento\Customer\Api\Data\CustomerInterface | $customer, |
$hash, | |||
$redirectUrl = '' |
|||
) |
Create customer account using provided hashed password. Should not be exposed as a webapi.
@api
\Magento\Customer\Api\Data\CustomerInterface | $customer | |
string | $hash | Password hash that we can save directly |
string | $redirectUrl | URL fed to welcome email templates. Can be used by templates to, for example, direct the customer to a product they were looking at after pressing confirmation link. |
getConfirmationStatus | ( | $customerId | ) |
Gets the account confirmation status.
int | $customerId |
Implemented in AccountManagement.
getDefaultBillingAddress | ( | $customerId | ) |
Retrieve default billing address for the given customerId.
int | $customerId |
Implemented in AccountManagement.
getDefaultShippingAddress | ( | $customerId | ) |
Retrieve default shipping address for the given customerId.
int | $customerId |
Implemented in AccountManagement.
getPasswordHash | ( | $password | ) |
Return hashed password, which can be directly saved to database.
string | $password |
Implemented in AccountManagement.
initiatePasswordReset | ( | $email, | |
$template, | |||
$websiteId = null |
|||
) |
Send an email to the customer with a password reset link.
string | ||
string | $template | |
int | $websiteId |
Implemented in AccountManagement.
isCustomerInStore | ( | $customerWebsiteId, | |
$storeId | |||
) |
Check store availability for customer given the customerId.
int | $customerWebsiteId | |
int | $storeId |
Implemented in AccountManagement.
isEmailAvailable | ( | $customerEmail, | |
$websiteId = null |
|||
) |
Check if given email is associated with a customer account in given website.
string | $customerEmail | |
int | $websiteId | If not set, will use the current websiteId |
Implemented in AccountManagement.
isReadonly | ( | $customerId | ) |
Check if customer can be deleted.
@api
int | $customerId |
Implemented in AccountManagement.
resendConfirmation | ( | $email, | |
$websiteId, | |||
$redirectUrl = '' |
|||
) |
Resend confirmation email.
string | ||
int | $websiteId | |
string | $redirectUrl |
Implemented in AccountManagement.
resetPassword | ( | $email, | |
$resetToken, | |||
$newPassword | |||
) |
Reset customer password.
string | If empty value given then the customer will be matched by the RP token. | |
string | $resetToken | |
string | $newPassword |
Implemented in AccountManagement.
validate | ( | \Magento\Customer\Api\Data\CustomerInterface | $customer | ) |
Validate customer data.
\Magento\Customer\Api\Data\CustomerInterface | $customer |
validateResetPasswordLinkToken | ( | $customerId, | |
$resetPasswordLinkToken | |||
) |
Check if password reset token is valid.
int | $customerId | If null is given then a customer will be matched by the RP token. |
string | $resetPasswordLinkToken |
Implemented in AccountManagement.
const ACCOUNT_CONFIRMATION_NOT_REQUIRED = 'account_confirmation_not_required' |
Definition at line 24 of file AccountManagementInterface.php.
const ACCOUNT_CONFIRMATION_REQUIRED = 'account_confirmation_required' |
Definition at line 23 of file AccountManagementInterface.php.
const ACCOUNT_CONFIRMED = 'account_confirmed' |
#+ Constant for confirmation status
Definition at line 22 of file AccountManagementInterface.php.
const MAX_PASSWORD_LENGTH = 256 |
Definition at line 25 of file AccountManagementInterface.php.