Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Customer.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Customer\Model;
8 
10 use Magento\Customer\Api\Data\CustomerInterfaceFactory;
13 use Magento\Customer\Model\ResourceModel\Address\CollectionFactory;
23 
47 {
51  const XML_PATH_REGISTER_EMAIL_TEMPLATE = 'customer/create_account/email_template';
52 
53  const XML_PATH_REGISTER_EMAIL_IDENTITY = 'customer/create_account/email_identity';
54 
55  const XML_PATH_REMIND_EMAIL_TEMPLATE = 'customer/password/remind_email_template';
56 
57  const XML_PATH_FORGOT_EMAIL_TEMPLATE = 'customer/password/forgot_email_template';
58 
59  const XML_PATH_FORGOT_EMAIL_IDENTITY = 'customer/password/forgot_email_identity';
60 
61  const XML_PATH_RESET_PASSWORD_TEMPLATE = 'customer/password/reset_password_template';
62 
67  const XML_PATH_IS_CONFIRM = 'customer/create_account/confirm';
68 
69  const XML_PATH_CONFIRM_EMAIL_TEMPLATE = 'customer/create_account/email_confirmation_template';
70 
71  const XML_PATH_CONFIRMED_EMAIL_TEMPLATE = 'customer/create_account/email_confirmed_template';
72 
73  const XML_PATH_GENERATE_HUMAN_FRIENDLY_ID = 'customer/create_account/generate_human_friendly_id';
74 
75  const SUBSCRIBED_YES = 'yes';
76 
77  const SUBSCRIBED_NO = 'no';
78 
79  const ENTITY = 'customer';
80 
81  const CUSTOMER_GRID_INDEXER_ID = 'customer_grid';
82 
86  const XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD = 'customer/password/reset_link_expiration_period';
87 
93  protected $_eventPrefix = 'customer';
94 
100  protected $_eventObject = 'customer';
101 
107  protected $_errors = [];
108 
114  protected $_attributes;
115 
122 
128  protected $_isDeleteable = true;
129 
135  protected $_isReadonly = false;
136 
140  protected $_storeManager;
141 
145  protected $_config;
146 
150  protected $_scopeConfig;
151 
155  protected $_configShare;
156 
160  protected $_addressFactory;
161 
166 
171 
175  protected $_groupRepository;
176 
180  protected $_encryptor;
181 
185  protected $mathRandom;
186 
190  protected $dateTime;
191 
196 
201 
205  protected $dataObjectHelper;
206 
210  protected $metadataService;
211 
215  protected $indexerRegistry;
216 
220  private $accountConfirmation;
221 
247  public function __construct(
248  \Magento\Framework\Model\Context $context,
249  \Magento\Framework\Registry $registry,
251  \Magento\Eav\Model\Config $config,
252  \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
254  \Magento\Customer\Model\Config\Share $configShare,
255  \Magento\Customer\Model\AddressFactory $addressFactory,
256  \Magento\Customer\Model\ResourceModel\Address\CollectionFactory $addressesFactory,
257  \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
259  \Magento\Framework\Encryption\EncryptorInterface $encryptor,
260  \Magento\Framework\Stdlib\DateTime $dateTime,
261  CustomerInterfaceFactory $customerDataFactory,
263  \Magento\Framework\Api\DataObjectHelper $dataObjectHelper,
265  \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry,
266  \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
267  array $data = [],
268  AccountConfirmation $accountConfirmation = null
269  ) {
270  $this->metadataService = $metadataService;
271  $this->_scopeConfig = $scopeConfig;
272  $this->_storeManager = $storeManager;
273  $this->_config = $config;
274  $this->_configShare = $configShare;
275  $this->_addressFactory = $addressFactory;
276  $this->_addressesFactory = $addressesFactory;
277  $this->_transportBuilder = $transportBuilder;
278  $this->_groupRepository = $groupRepository;
279  $this->_encryptor = $encryptor;
280  $this->dateTime = $dateTime;
281  $this->customerDataFactory = $customerDataFactory;
282  $this->dataObjectProcessor = $dataObjectProcessor;
283  $this->dataObjectHelper = $dataObjectHelper;
284  $this->indexerRegistry = $indexerRegistry;
285  $this->accountConfirmation = $accountConfirmation ?: ObjectManager::getInstance()
286  ->get(AccountConfirmation::class);
287  parent::__construct(
288  $context,
289  $registry,
290  $resource,
291  $resourceCollection,
292  $data
293  );
294  }
295 
301  public function _construct()
302  {
303  $this->_init(\Magento\Customer\Model\ResourceModel\Customer::class);
304  }
305 
311  public function getDataModel()
312  {
313  $customerData = $this->getData();
314  $addressesData = [];
316  foreach ($this->getAddresses() as $address) {
317  $addressesData[] = $address->getDataModel();
318  }
319  $customerDataObject = $this->customerDataFactory->create();
320  $this->dataObjectHelper->populateWithArray(
321  $customerDataObject,
323  \Magento\Customer\Api\Data\CustomerInterface::class
324  );
325  $customerDataObject->setAddresses($addressesData)
326  ->setId($this->getId());
327  return $customerDataObject;
328  }
329 
336  public function updateData($customer)
337  {
338  $customerDataAttributes = $this->dataObjectProcessor->buildOutputDataArray(
339  $customer,
340  \Magento\Customer\Api\Data\CustomerInterface::class
341  );
342 
343  foreach ($customerDataAttributes as $attributeCode => $attributeData) {
344  if ($attributeCode == 'password') {
345  continue;
346  }
348  }
349 
350  $customAttributes = $customer->getCustomAttributes();
351  if ($customAttributes !== null) {
352  foreach ($customAttributes as $attribute) {
353  $this->setData($attribute->getAttributeCode(), $attribute->getValue());
354  }
355  }
356 
357  $customerId = $customer->getId();
358  if ($customerId) {
359  $this->setId($customerId);
360  }
361 
362  // Need to use attribute set or future updates can cause data loss
363  if (!$this->getAttributeSetId()) {
364  $this->setAttributeSetId(
366  );
367  }
368 
369  return $this;
370  }
371 
377  public function getSharingConfig()
378  {
379  return $this->_configShare;
380  }
381 
391  public function authenticate($login, $password)
392  {
393  $this->loadByEmail($login);
394  if ($this->getConfirmation() && $this->isConfirmationRequired()) {
395  throw new EmailNotConfirmedException(
396  __("This account isn't confirmed. Verify and try again.")
397  );
398  }
399  if (!$this->validatePassword($password)) {
401  __('Invalid login or password.')
402  );
403  }
404  $this->_eventManager->dispatch(
405  'customer_customer_authenticated',
406  ['model' => $this, 'password' => $password]
407  );
408 
409  return true;
410  }
411 
418  public function loadByEmail($customerEmail)
419  {
420  $this->_getResource()->loadByEmail($this, $customerEmail);
421  return $this;
422  }
423 
430  public function changePassword($newPassword)
431  {
432  $this->_getResource()->changePassword($this, $newPassword);
433  return $this;
434  }
435 
441  public function getName()
442  {
443  $name = '';
444 
445  if ($this->_config->getAttribute('customer', 'prefix')->getIsVisible() && $this->getPrefix()) {
446  $name .= $this->getPrefix() . ' ';
447  }
448  $name .= $this->getFirstname();
449  if ($this->_config->getAttribute('customer', 'middlename')->getIsVisible() && $this->getMiddlename()) {
450  $name .= ' ' . $this->getMiddlename();
451  }
452  $name .= ' ' . $this->getLastname();
453  if ($this->_config->getAttribute('customer', 'suffix')->getIsVisible() && $this->getSuffix()) {
454  $name .= ' ' . $this->getSuffix();
455  }
456  return $name;
457  }
458 
465  public function addAddress(Address $address)
466  {
467  $this->getAddressesCollection()->addItem($address);
468  return $this;
469  }
470 
477  public function getAddressById($addressId)
478  {
479  return $this->_createAddressInstance()->load($addressId);
480  }
481 
488  public function getAddressItemById($addressId)
489  {
490  return $this->getAddressesCollection()->getItemById($addressId);
491  }
492 
498  public function getAddressCollection()
499  {
500  return $this->_createAddressCollection();
501  }
502 
508  public function getAddressesCollection()
509  {
510  if ($this->_addressesCollection === null) {
511  $this->_addressesCollection = $this->getAddressCollection()->setCustomerFilter(
512  $this
513  )->addAttributeToSelect(
514  '*'
515  );
516  foreach ($this->_addressesCollection as $address) {
517  $address->setCustomer($this);
518  }
519  }
520 
522  }
523 
529  public function getAddresses()
530  {
531  return $this->getAddressesCollection()->getItems();
532  }
533 
539  public function getAttributes()
540  {
541  if ($this->_attributes === null) {
542  $this->_attributes = $this->_getResource()->loadAllAttributes($this)->getSortedAttributes();
543  }
544  return $this->_attributes;
545  }
546 
553  public function getAttribute($attributeCode)
554  {
555  $this->getAttributes();
556  if (isset($this->_attributes[$attributeCode])) {
557  return $this->_attributes[$attributeCode];
558  }
559  return null;
560  }
561 
568  public function setPassword($password)
569  {
570  $this->setData('password', $password);
571  $this->setPasswordHash($this->hashPassword($password));
572  return $this;
573  }
574 
582  public function hashPassword($password, $salt = true)
583  {
584  return $this->_encryptor->getHash($password, $salt);
585  }
586 
593  public function validatePassword($password)
594  {
595  $hash = $this->getPasswordHash();
596  if (!$hash) {
597  return false;
598  }
599  return $this->_encryptor->validateHash($password, $hash);
600  }
601 
608  public function encryptPassword($password)
609  {
610  return $this->_encryptor->encrypt($password);
611  }
612 
619  public function decryptPassword($password)
620  {
621  return $this->_encryptor->decrypt($password);
622  }
623 
631  {
632  $primaryAddress = $this->getAddressesCollection()->getItemById($this->getData($attributeCode));
633 
634  return $primaryAddress ? $primaryAddress : false;
635  }
636 
642  public function getPrimaryBillingAddress()
643  {
644  return $this->getPrimaryAddress('default_billing');
645  }
646 
652  public function getDefaultBillingAddress()
653  {
654  return $this->getPrimaryBillingAddress();
655  }
656 
662  public function getPrimaryShippingAddress()
663  {
664  return $this->getPrimaryAddress('default_shipping');
665  }
666 
672  public function getDefaultShippingAddress()
673  {
674  return $this->getPrimaryShippingAddress();
675  }
676 
682  public function getPrimaryAddressIds()
683  {
684  $ids = [];
685  if ($this->getDefaultBilling()) {
686  $ids[] = $this->getDefaultBilling();
687  }
688  if ($this->getDefaultShipping()) {
689  $ids[] = $this->getDefaultShipping();
690  }
691  return $ids;
692  }
693 
699  public function getPrimaryAddresses()
700  {
701  $addresses = [];
702  $primaryBilling = $this->getPrimaryBillingAddress();
703  if ($primaryBilling) {
704  $addresses[] = $primaryBilling;
705  $primaryBilling->setIsPrimaryBilling(true);
706  }
707 
708  $primaryShipping = $this->getPrimaryShippingAddress();
709  if ($primaryShipping) {
710  if ($primaryBilling && $primaryBilling->getId() == $primaryShipping->getId()) {
711  $primaryBilling->setIsPrimaryShipping(true);
712  } else {
713  $primaryShipping->setIsPrimaryShipping(true);
714  $addresses[] = $primaryShipping;
715  }
716  }
717  return $addresses;
718  }
719 
725  public function getAdditionalAddresses()
726  {
727  $addresses = [];
728  $primatyIds = $this->getPrimaryAddressIds();
729  foreach ($this->getAddressesCollection() as $address) {
730  if (!in_array($address->getId(), $primatyIds)) {
731  $addresses[] = $address;
732  }
733  }
734  return $addresses;
735  }
736 
744  {
745  if (!$address->getId()) {
746  return false;
747  }
748  return $address->getId() == $this->getDefaultBilling() || $address->getId() == $this->getDefaultShipping();
749  }
750 
760  public function sendNewAccountEmail($type = 'registered', $backUrl = '', $storeId = '0')
761  {
762  $types = $this->getTemplateTypes();
763 
764  if (!isset($types[$type])) {
765  throw new \Magento\Framework\Exception\LocalizedException(
766  __('The transactional account email type is incorrect. Verify and try again.')
767  );
768  }
769 
770  if (!$storeId) {
771  $storeId = $this->_getWebsiteStoreId($this->getSendemailStoreId());
772  }
773 
774  $this->_sendEmailTemplate(
775  $types[$type],
776  self::XML_PATH_REGISTER_EMAIL_IDENTITY,
777  ['customer' => $this, 'back_url' => $backUrl, 'store' => $this->getStore()],
778  $storeId
779  );
780 
781  return $this;
782  }
783 
791  public function isConfirmationRequired()
792  {
793  $websiteId = $this->getWebsiteId() ? $this->getWebsiteId() : null;
794 
795  return $this->accountConfirmation->isConfirmationRequired($websiteId, $this->getId(), $this->getEmail());
796  }
797 
803  public function getRandomConfirmationKey()
804  {
805  return md5(uniqid());
806  }
807 
813  public function sendPasswordReminderEmail()
814  {
815  $this->_sendEmailTemplate(
816  self::XML_PATH_REMIND_EMAIL_TEMPLATE,
817  self::XML_PATH_FORGOT_EMAIL_IDENTITY,
818  ['customer' => $this, 'store' => $this->getStore()],
819  $this->getStoreId()
820  );
821 
822  return $this;
823  }
824 
834  protected function _sendEmailTemplate($template, $sender, $templateParams = [], $storeId = null)
835  {
837  $transport = $this->_transportBuilder->setTemplateIdentifier(
838  $this->_scopeConfig->getValue($template, ScopeInterface::SCOPE_STORE, $storeId)
839  )->setTemplateOptions(
840  ['area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => $storeId]
841  )->setTemplateVars(
842  $templateParams
843  )->setFrom(
844  $this->_scopeConfig->getValue($sender, ScopeInterface::SCOPE_STORE, $storeId)
845  )->addTo(
846  $this->getEmail(),
847  $this->getName()
848  )->getTransport();
849  $transport->sendMessage();
850 
851  return $this;
852  }
853 
860  {
861  $storeId = $this->getStoreId();
862  if (!$storeId) {
863  $storeId = $this->_getWebsiteStoreId();
864  }
865 
866  $this->_sendEmailTemplate(
867  self::XML_PATH_FORGOT_EMAIL_TEMPLATE,
868  self::XML_PATH_FORGOT_EMAIL_IDENTITY,
869  ['customer' => $this, 'store' => $this->getStore()],
870  $storeId
871  );
872 
873  return $this;
874  }
875 
881  public function getGroupId()
882  {
883  if (!$this->hasData('group_id')) {
884  $storeId = $this->getStoreId() ? $this->getStoreId() : $this->_storeManager->getStore()->getId();
885  $groupId = $this->_scopeConfig->getValue(
887  ScopeInterface::SCOPE_STORE,
888  $storeId
889  );
890  $this->setData('group_id', $groupId);
891  }
892  return $this->getData('group_id');
893  }
894 
900  public function getTaxClassId()
901  {
902  if (!$this->getData('tax_class_id')) {
903  $groupTaxClassId = $this->_groupRepository->getById($this->getGroupId())->getTaxClassId();
904  $this->setData('tax_class_id', $groupTaxClassId);
905  }
906  return $this->getData('tax_class_id');
907  }
908 
914  public function getStore()
915  {
916  return $this->_storeManager->getStore($this->getStoreId());
917  }
918 
924  public function getSharedStoreIds()
925  {
926  $ids = $this->_getData('shared_store_ids');
927  if ($ids === null) {
928  $ids = [];
929  if ((bool)$this->getSharingConfig()->isWebsiteScope()) {
930  $ids = $this->_storeManager->getWebsite($this->getWebsiteId())->getStoreIds();
931  } else {
932  foreach ($this->_storeManager->getStores() as $store) {
933  $ids[] = $store->getId();
934  }
935  }
936  $this->setData('shared_store_ids', $ids);
937  }
938 
939  return $ids;
940  }
941 
947  public function getSharedWebsiteIds()
948  {
949  $ids = $this->_getData('shared_website_ids');
950  if ($ids === null) {
951  $ids = [];
952  if ((bool)$this->getSharingConfig()->isWebsiteScope()) {
953  $ids[] = $this->getWebsiteId();
954  } else {
955  foreach ($this->_storeManager->getWebsites() as $website) {
956  $ids[] = $website->getId();
957  }
958  }
959  $this->setData('shared_website_ids', $ids);
960  }
961  return $ids;
962  }
963 
970  public function setStore(\Magento\Store\Model\Store $store)
971  {
972  $this->setStoreId($store->getId());
973  $this->setWebsiteId($store->getWebsite()->getId());
974  return $this;
975  }
976 
983  public function validate()
984  {
985  return true;
986  }
987 
993  public function unsetSubscription()
994  {
995  if (isset($this->_isSubscribed)) {
996  unset($this->_isSubscribed);
997  }
998  return $this;
999  }
1000 
1006  public function cleanAllAddresses()
1007  {
1008  $this->_addressesCollection = null;
1009  }
1010 
1017  public function addError($error)
1018  {
1019  $this->_errors[] = $error;
1020  return $this;
1021  }
1022 
1028  public function getErrors()
1029  {
1030  return $this->_errors;
1031  }
1032 
1038  public function resetErrors()
1039  {
1040  $this->_errors = [];
1041  return $this;
1042  }
1043 
1049  public function beforeDelete()
1050  {
1051  //TODO : Revisit and figure handling permissions in MAGETWO-11084 Implementation: Service Context Provider
1052  return parent::beforeDelete();
1053  }
1054 
1060  public function afterSave()
1061  {
1062  $indexer = $this->indexerRegistry->get(self::CUSTOMER_GRID_INDEXER_ID);
1063  if ($indexer->getState()->getStatus() == StateInterface::STATUS_VALID) {
1064  $this->_getResource()->addCommitCallback([$this, 'reindex']);
1065  }
1066  return parent::afterSave();
1067  }
1068 
1074  public function afterDeleteCommit()
1075  {
1076  $this->reindex();
1077  return parent::afterDeleteCommit();
1078  }
1079 
1085  public function reindex()
1086  {
1088  $indexer = $this->indexerRegistry->get(self::CUSTOMER_GRID_INDEXER_ID);
1089  $indexer->reindexRow($this->getId());
1090  }
1091 
1097  public function getCreatedAtTimestamp()
1098  {
1099  $date = $this->getCreatedAt();
1100  if ($date) {
1101  return (new \DateTime($date))->getTimestamp();
1102  }
1103  return null;
1104  }
1105 
1111  public function reset()
1112  {
1113  $this->setData([]);
1114  $this->setOrigData();
1115  $this->_attributes = null;
1116 
1117  return $this;
1118  }
1119 
1125  public function isDeleteable()
1126  {
1127  return $this->_isDeleteable;
1128  }
1129 
1136  public function setIsDeleteable($value)
1137  {
1138  $this->_isDeleteable = (bool)$value;
1139  return $this;
1140  }
1141 
1147  public function isReadonly()
1148  {
1149  return $this->_isReadonly;
1150  }
1151 
1158  public function setIsReadonly($value)
1159  {
1160  $this->_isReadonly = (bool)$value;
1161  return $this;
1162  }
1163 
1171  protected function canSkipConfirmation()
1172  {
1173  if (!$this->getId()) {
1174  return false;
1175  }
1176 
1177  /* If an email was used to start the registration process and it is the same email as the one
1178  used to register, then this can skip confirmation.
1179  */
1180  $skipConfirmationIfEmail = $this->_registry->registry("skip_confirmation_if_email");
1181  if (!$skipConfirmationIfEmail) {
1182  return false;
1183  }
1184 
1185  return strtolower($skipConfirmationIfEmail) === strtolower($this->getEmail());
1186  }
1187 
1193  public function __clone()
1194  {
1195  $newAddressCollection = $this->getPrimaryAddresses();
1196  $newAddressCollection = array_merge($newAddressCollection, $this->getAdditionalAddresses());
1197  $this->setId(null);
1198  $this->cleanAllAddresses();
1199  foreach ($newAddressCollection as $address) {
1200  $this->addAddress(clone $address);
1201  }
1202  }
1203 
1209  public function getEntityType()
1210  {
1211  return $this->_getResource()->getEntityType();
1212  }
1213 
1221  protected function _getWebsiteStoreId($defaultStoreId = null)
1222  {
1223  if ($this->getWebsiteId() != 0 && empty($defaultStoreId)) {
1224  $storeIds = $this->_storeManager->getWebsite($this->getWebsiteId())->getStoreIds();
1225  reset($storeIds);
1226  $defaultStoreId = current($storeIds);
1227  }
1228  return $defaultStoreId;
1229  }
1230 
1240  public function changeResetPasswordLinkToken($passwordLinkToken)
1241  {
1242  if (!is_string($passwordLinkToken) || empty($passwordLinkToken)) {
1243  throw new AuthenticationException(
1244  __('A valid password reset token is missing. Enter and try again.')
1245  );
1246  }
1247  $this->_getResource()->changeResetPasswordLinkToken($this, $passwordLinkToken);
1248  return $this;
1249  }
1250 
1257  {
1258  $linkToken = $this->getRpToken();
1259  $linkTokenCreatedAt = $this->getRpTokenCreatedAt();
1260 
1261  if (empty($linkToken) || empty($linkTokenCreatedAt)) {
1262  return true;
1263  }
1264 
1265  $expirationPeriod = $this->getResetPasswordLinkExpirationPeriod();
1266 
1267  $currentTimestamp = (new \DateTime())->getTimestamp();
1268  $tokenTimestamp = (new \DateTime($linkTokenCreatedAt))->getTimestamp();
1269  if ($tokenTimestamp > $currentTimestamp) {
1270  return true;
1271  }
1272 
1273  $dayDifference = floor(($currentTimestamp - $tokenTimestamp) / (24 * 60 * 60));
1274  if ($dayDifference >= $expirationPeriod) {
1275  return true;
1276  }
1277 
1278  return false;
1279  }
1280 
1287  {
1288  return (int)$this->_scopeConfig->getValue(
1289  self::XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD,
1291  );
1292  }
1293 
1297  protected function _createAddressInstance()
1298  {
1299  return $this->_addressFactory->create();
1300  }
1301 
1305  protected function _createAddressCollection()
1306  {
1307  return $this->_addressesFactory->create();
1308  }
1309 
1313  protected function getTemplateTypes()
1314  {
1320  $types = [
1323  'confirmation' => self::XML_PATH_CONFIRM_EMAIL_TEMPLATE,
1324  ];
1325  return $types;
1326  }
1327 
1334  public function isCustomerLocked()
1335  {
1336  if ($this->getLockExpires()) {
1337  $lockExpires = new \DateTime($this->getLockExpires());
1338  if ($lockExpires > new \DateTime()) {
1339  return true;
1340  }
1341  }
1342  return false;
1343  }
1344 
1351  public function getPasswordConfirm()
1352  {
1353  return (string) $this->getData('password_confirm');
1354  }
1355 
1362  public function getPassword()
1363  {
1364  return (string) $this->getData('password');
1365  }
1366 }
const XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD
Definition: Customer.php:86
$customerData
$groupRepository
getData($key='', $index=null)
Definition: DataObject.php:119
setStore(\Magento\Store\Model\Store $store)
Definition: Customer.php:970
sendNewAccountEmail($type='registered', $backUrl='', $storeId='0')
Definition: Customer.php:760
$customer
Definition: customers.php:11
$config
Definition: fraud_order.php:17
$addresses
Definition: address_list.php:7
_getWebsiteStoreId($defaultStoreId=null)
Definition: Customer.php:1221
$storeManager
__()
Definition: __.php:13
$resource
Definition: bulk.php:12
addAddress(Address $address)
Definition: Customer.php:465
authenticate($login, $password)
Definition: Customer.php:391
$address
Definition: customer.php:38
$type
Definition: item.phtml:13
isAddressPrimary(Address $address)
Definition: Customer.php:743
hashPassword($password, $salt=true)
Definition: Customer.php:582
$addressFactory
Definition: quote.php:20
$value
Definition: gender.phtml:16
getPrimaryAddress($attributeCode)
Definition: Customer.php:630
$attributeCode
Definition: extend.phtml:12
getAttribute($attributeCode)
Definition: Customer.php:553
changeResetPasswordLinkToken($passwordLinkToken)
Definition: Customer.php:1240
setDataUsingMethod($key, $args=[])
Definition: DataObject.php:204
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $config, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Customer\Model\ResourceModel\Customer $resource, \Magento\Customer\Model\Config\Share $configShare, \Magento\Customer\Model\AddressFactory $addressFactory, \Magento\Customer\Model\ResourceModel\Address\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, \Magento\Customer\Api\CustomerMetadataInterface $metadataService, \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[], AccountConfirmation $accountConfirmation=null)
Definition: Customer.php:247
$template
Definition: export.php:12
if(!isset($_GET['name'])) $name
Definition: log.php:14