Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Data Fields | |
const | XML_PATH_REGISTER_EMAIL_TEMPLATE = 'customer/create_account/email_template' |
const | XML_PATH_REGISTER_EMAIL_IDENTITY = 'customer/create_account/email_identity' |
const | XML_PATH_REMIND_EMAIL_TEMPLATE = 'customer/password/remind_email_template' |
const | XML_PATH_FORGOT_EMAIL_TEMPLATE = 'customer/password/forgot_email_template' |
const | XML_PATH_FORGOT_EMAIL_IDENTITY = 'customer/password/forgot_email_identity' |
const | XML_PATH_RESET_PASSWORD_TEMPLATE = 'customer/password/reset_password_template' |
const | XML_PATH_IS_CONFIRM = 'customer/create_account/confirm' |
const | XML_PATH_CONFIRM_EMAIL_TEMPLATE = 'customer/create_account/email_confirmation_template' |
const | XML_PATH_CONFIRMED_EMAIL_TEMPLATE = 'customer/create_account/email_confirmed_template' |
const | XML_PATH_GENERATE_HUMAN_FRIENDLY_ID = 'customer/create_account/generate_human_friendly_id' |
const | SUBSCRIBED_YES = 'yes' |
const | SUBSCRIBED_NO = 'no' |
const | ENTITY = 'customer' |
const | CUSTOMER_GRID_INDEXER_ID = 'customer_grid' |
const | XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD = 'customer/password/reset_link_expiration_period' |
Protected Member Functions | |
canSkipConfirmation () | |
_getWebsiteStoreId ($defaultStoreId=null) | |
_createAddressInstance () | |
_createAddressCollection () | |
getTemplateTypes () | |
![]() | |
_construct () | |
_init ($resourceModel) | |
_setResourceModel ($resourceName, $collectionName=null) | |
_getResource () | |
_getEventData () | |
_beforeLoad ($modelId, $field=null) | |
_afterLoad () | |
_hasModelChanged () | |
_getValidatorBeforeSave () | |
_createValidatorBeforeSave () | |
_getValidationRulesBeforeSave () | |
_clearReferences () | |
_clearData () | |
![]() | |
_getData ($key) | |
_underscore ($name) | |
Protected Attributes | |
$_eventPrefix = 'customer' | |
$_eventObject = 'customer' | |
$_errors = [] | |
$_attributes | |
$_addressesCollection | |
$_isDeleteable = true | |
$_isReadonly = false | |
$_storeManager | |
$_config | |
$_scopeConfig | |
$_configShare | |
$_addressFactory | |
$_addressesFactory | |
$_transportBuilder | |
$_groupRepository | |
$_encryptor | |
$mathRandom | |
$dateTime | |
$customerDataFactory | |
$dataObjectProcessor | |
$dataObjectHelper | |
$metadataService | |
$indexerRegistry | |
![]() | |
$_eventPrefix = 'core_abstract' | |
$_eventObject = 'object' | |
$_idFieldName = 'id' | |
$_hasDataChanges = false | |
$_origData | |
$_isDeleted = false | |
$_resource | |
$_resourceCollection | |
$_resourceName | |
$_collectionName | |
$_cacheTag = false | |
$_dataSaveAllowed = true | |
$_isObjectNew = null | |
$_validatorBeforeSave = null | |
$_eventManager | |
$_cacheManager | |
$_registry | |
$_logger | |
$_appState | |
$_actionValidator | |
$storedData = [] | |
![]() | |
$_data = [] | |
Additional Inherited Members | |
![]() | |
static | $_underscoreCache = [] |
Customer model
@api @method int getWebsiteId() getWebsiteId() @method Customer setWebsiteId($value) @method int getStoreId() getStoreId() @method string getEmail() getEmail() @method mixed getDisableAutoGroupChange() @method Customer setDisableAutoGroupChange($value) @method Customer setGroupId($value) @method Customer setDefaultBilling($value) @method Customer setDefaultShipping($value) @method Customer setPasswordHash($string) @method string getPasswordHash() @method string getConfirmation() @SuppressWarnings(PHPMD.ExcessivePublicCount) @SuppressWarnings(PHPMD.TooManyFields) @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 46 of file Customer.php.
\Magento\Framework\Model\Context | $context | |
\Magento\Framework\Registry | $registry | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
\Magento\Eav\Model\Config | $config | |
ScopeConfigInterface | $scopeConfig | |
ResourceCustomer | $resource | |
Share | $configShare | |
AddressFactory | $addressFactory | |
CollectionFactory | $addressesFactory | |
\Magento\Framework\Mail\Template\TransportBuilder | $transportBuilder | |
GroupRepositoryInterface | $groupRepository | |
\Magento\Framework\Encryption\EncryptorInterface | $encryptor | |
\Magento\Framework\Stdlib\DateTime | $dateTime | |
CustomerInterfaceFactory | $customerDataFactory | |
DataObjectProcessor | $dataObjectProcessor | |
\Magento\Framework\Api\DataObjectHelper | $dataObjectHelper | |
CustomerMetadataInterface | $metadataService | |
\Magento\Framework\Indexer\IndexerRegistry | $indexerRegistry | |
\Magento\Framework\Data\Collection\AbstractDb | null | $resourceCollection | |
array | $data | |
AccountConfirmation | null | $accountConfirmation | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 247 of file Customer.php.
__clone | ( | ) |
Clone current object
Definition at line 1193 of file Customer.php.
_construct | ( | ) |
|
protected |
Definition at line 1305 of file Customer.php.
|
protected |
Definition at line 1297 of file Customer.php.
|
protected |
Get either first store ID from a set website or the provided as default
int | string | null | $defaultStoreId |
Definition at line 1221 of file Customer.php.
addAddress | ( | Address | $address | ) |
Add address to address collection
Address | $address |
Definition at line 465 of file Customer.php.
addError | ( | $error | ) |
afterDeleteCommit | ( | ) |
Init indexing process after customer delete
Definition at line 1074 of file Customer.php.
afterSave | ( | ) |
Processing object after save data
Definition at line 1060 of file Customer.php.
authenticate | ( | $login, | |
$password | |||
) |
Authenticate customer
string | $login | |
string | $password |
Definition at line 391 of file Customer.php.
beforeDelete | ( | ) |
|
protected |
Check whether confirmation may be skipped when registering using certain email address
Definition at line 1171 of file Customer.php.
changePassword | ( | $newPassword | ) |
Change customer password
string | $newPassword |
Definition at line 430 of file Customer.php.
changeResetPasswordLinkToken | ( | $passwordLinkToken | ) |
Change reset password link token
Stores new reset password link token
string | $passwordLinkToken |
Definition at line 1240 of file Customer.php.
cleanAllAddresses | ( | ) |
decryptPassword | ( | $password | ) |
Decrypt password
string | $password |
Definition at line 619 of file Customer.php.
encryptPassword | ( | $password | ) |
Encrypt password
string | $password |
Definition at line 608 of file Customer.php.
getAdditionalAddresses | ( | ) |
Retrieve not default addresses
Definition at line 725 of file Customer.php.
getAddressById | ( | $addressId | ) |
Retrieve customer address by address id
int | $addressId |
Definition at line 477 of file Customer.php.
getAddressCollection | ( | ) |
Retrieve not loaded address collection
Definition at line 498 of file Customer.php.
getAddresses | ( | ) |
Retrieve customer address array
Definition at line 529 of file Customer.php.
getAddressesCollection | ( | ) |
Customer addresses collection
Definition at line 508 of file Customer.php.
getAddressItemById | ( | $addressId | ) |
Getting customer address object from collection by identifier
int | $addressId |
Definition at line 488 of file Customer.php.
getAttribute | ( | $attributeCode | ) |
Get customer attribute model object
string | $attributeCode |
Definition at line 553 of file Customer.php.
getAttributes | ( | ) |
getCreatedAtTimestamp | ( | ) |
Get customer created at date timestamp
Definition at line 1097 of file Customer.php.
getDefaultBillingAddress | ( | ) |
Get customer default billing address
Definition at line 652 of file Customer.php.
getDefaultShippingAddress | ( | ) |
Get default customer shipping address
Definition at line 672 of file Customer.php.
getEntityType | ( | ) |
Return Entity Type instance
Definition at line 1209 of file Customer.php.
getErrors | ( | ) |
getGroupId | ( | ) |
Retrieve customer group identifier
Definition at line 881 of file Customer.php.
getName | ( | ) |
Get full customer name
Definition at line 441 of file Customer.php.
getPassword | ( | ) |
getPasswordConfirm | ( | ) |
Return Password Confirmation
Definition at line 1351 of file Customer.php.
getPrimaryAddress | ( | $attributeCode | ) |
Retrieve default address by type(attribute)
string | $attributeCode | address type attribute code |
Definition at line 630 of file Customer.php.
getPrimaryAddresses | ( | ) |
Retrieve all customer default addresses
Definition at line 699 of file Customer.php.
getPrimaryAddressIds | ( | ) |
getPrimaryBillingAddress | ( | ) |
Get customer default billing address
Definition at line 642 of file Customer.php.
getPrimaryShippingAddress | ( | ) |
Get default customer shipping address
Definition at line 662 of file Customer.php.
getRandomConfirmationKey | ( | ) |
getResetPasswordLinkExpirationPeriod | ( | ) |
Retrieve customer reset password link expiration period in days
Definition at line 1286 of file Customer.php.
getSharedStoreIds | ( | ) |
Retrieve shared store ids
Definition at line 924 of file Customer.php.
getSharedWebsiteIds | ( | ) |
Retrieve shared website ids
Definition at line 947 of file Customer.php.
getSharingConfig | ( | ) |
Retrieve customer sharing configuration model
Definition at line 377 of file Customer.php.
getStore | ( | ) |
Retrieve store where customer was created
Definition at line 914 of file Customer.php.
getTaxClassId | ( | ) |
Retrieve customer tax class identifier
Definition at line 900 of file Customer.php.
|
protected |
'registered' welcome email, when confirmation is disabled 'confirmed' welcome email, when confirmation is enabled 'confirmation' email with confirmation link
Definition at line 1313 of file Customer.php.
hashPassword | ( | $password, | |
$salt = true |
|||
) |
Hash customer password
string | $password | |
bool | int | string | $salt |
Definition at line 582 of file Customer.php.
isAddressPrimary | ( | Address | $address | ) |
Check if address is primary
Address | $address |
Definition at line 743 of file Customer.php.
isConfirmationRequired | ( | ) |
Check if accounts confirmation is required in config
Definition at line 791 of file Customer.php.
isCustomerLocked | ( | ) |
Check if customer is locked
Definition at line 1334 of file Customer.php.
isDeleteable | ( | ) |
isReadonly | ( | ) |
isResetPasswordLinkTokenExpired | ( | ) |
Check if current reset password link token is expired
Definition at line 1256 of file Customer.php.
loadByEmail | ( | $customerEmail | ) |
Load customer by email
string | $customerEmail |
Definition at line 418 of file Customer.php.
reset | ( | ) |
Reset all model data
Definition at line 1111 of file Customer.php.
resetErrors | ( | ) |
sendNewAccountEmail | ( | $type = 'registered' , |
|
$backUrl = '' , |
|||
$storeId = '0' |
|||
) |
Send email with new account related information
string | $type | |
string | $backUrl | |
string | $storeId |
Definition at line 760 of file Customer.php.
sendPasswordReminderEmail | ( | ) |
sendPasswordResetConfirmationEmail | ( | ) |
Send email with reset password confirmation link
Definition at line 859 of file Customer.php.
setIsDeleteable | ( | $value | ) |
Set is deletable flag
boolean | $value |
Definition at line 1136 of file Customer.php.
setIsReadonly | ( | $value | ) |
Set is readonly flag
boolean | $value |
Definition at line 1158 of file Customer.php.
setPassword | ( | $password | ) |
Set plain and hashed password
string | $password |
Definition at line 568 of file Customer.php.
setStore | ( | \Magento\Store\Model\Store | $store | ) |
Set store to customer
\Magento\Store\Model\Store | $store |
Definition at line 970 of file Customer.php.
unsetSubscription | ( | ) |
updateData | ( | $customer | ) |
Update customer data
\Magento\Customer\Api\Data\CustomerInterface | $customer |
Definition at line 336 of file Customer.php.
validate | ( | ) |
Validate customer attribute values.
Definition at line 983 of file Customer.php.
validatePassword | ( | $password | ) |
Validate password with salted hash
string | $password |
Definition at line 593 of file Customer.php.
|
protected |
Definition at line 121 of file Customer.php.
|
protected |
Definition at line 165 of file Customer.php.
|
protected |
Definition at line 160 of file Customer.php.
|
protected |
Definition at line 114 of file Customer.php.
|
protected |
Definition at line 145 of file Customer.php.
|
protected |
Definition at line 155 of file Customer.php.
|
protected |
Definition at line 180 of file Customer.php.
|
protected |
Definition at line 107 of file Customer.php.
|
protected |
Definition at line 100 of file Customer.php.
|
protected |
Definition at line 93 of file Customer.php.
|
protected |
Definition at line 175 of file Customer.php.
|
protected |
Definition at line 128 of file Customer.php.
|
protected |
Definition at line 135 of file Customer.php.
|
protected |
Definition at line 150 of file Customer.php.
|
protected |
Definition at line 140 of file Customer.php.
|
protected |
Definition at line 170 of file Customer.php.
|
protected |
Definition at line 195 of file Customer.php.
|
protected |
Definition at line 205 of file Customer.php.
|
protected |
Definition at line 200 of file Customer.php.
|
protected |
Definition at line 190 of file Customer.php.
|
protected |
Definition at line 215 of file Customer.php.
|
protected |
Definition at line 185 of file Customer.php.
|
protected |
Definition at line 210 of file Customer.php.
const CUSTOMER_GRID_INDEXER_ID = 'customer_grid' |
Definition at line 81 of file Customer.php.
const ENTITY = 'customer' |
Definition at line 79 of file Customer.php.
const SUBSCRIBED_NO = 'no' |
Definition at line 77 of file Customer.php.
const SUBSCRIBED_YES = 'yes' |
Definition at line 75 of file Customer.php.
const XML_PATH_CONFIRM_EMAIL_TEMPLATE = 'customer/create_account/email_confirmation_template' |
Definition at line 69 of file Customer.php.
const XML_PATH_CONFIRMED_EMAIL_TEMPLATE = 'customer/create_account/email_confirmed_template' |
Definition at line 71 of file Customer.php.
const XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD = 'customer/password/reset_link_expiration_period' |
Configuration path to expiration period of reset password link
Definition at line 86 of file Customer.php.
const XML_PATH_FORGOT_EMAIL_IDENTITY = 'customer/password/forgot_email_identity' |
Definition at line 59 of file Customer.php.
const XML_PATH_FORGOT_EMAIL_TEMPLATE = 'customer/password/forgot_email_template' |
Definition at line 57 of file Customer.php.
const XML_PATH_GENERATE_HUMAN_FRIENDLY_ID = 'customer/create_account/generate_human_friendly_id' |
Definition at line 73 of file Customer.php.
const XML_PATH_IS_CONFIRM = 'customer/create_account/confirm' |
Definition at line 67 of file Customer.php.
const XML_PATH_REGISTER_EMAIL_IDENTITY = 'customer/create_account/email_identity' |
Definition at line 53 of file Customer.php.
const XML_PATH_REGISTER_EMAIL_TEMPLATE = 'customer/create_account/email_template' |
Configuration paths for email templates and identities
Definition at line 51 of file Customer.php.
const XML_PATH_REMIND_EMAIL_TEMPLATE = 'customer/password/remind_email_template' |
Definition at line 55 of file Customer.php.
const XML_PATH_RESET_PASSWORD_TEMPLATE = 'customer/password/reset_password_template' |
Definition at line 61 of file Customer.php.