Пример #1
0
 /**
  * Change reset password link token
  *
  * Stores new reset password link token and its creation time
  *
  * @param \Magento\Customer\Model\Customer $customer
  * @param string $passwordLinkToken
  * @return $this
  */
 public function changeResetPasswordLinkToken(\Magento\Customer\Model\Customer $customer, $passwordLinkToken)
 {
     if (is_string($passwordLinkToken) && !empty($passwordLinkToken)) {
         $customer->setRpToken($passwordLinkToken);
         $customer->setRpTokenCreatedAt((new \DateTime())->format(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT));
         $this->saveAttribute($customer, 'rp_token');
         $this->saveAttribute($customer, 'rp_token_created_at');
     }
     return $this;
 }
Пример #2
0
 /**
  * Change reset password link token
  *
  * Stores new reset password link token and its creation time
  *
  * @param \Magento\Customer\Model\Customer $customer
  * @param string $passwordLinkToken
  * @return $this
  */
 public function changeResetPasswordLinkToken(\Magento\Customer\Model\Customer $customer, $passwordLinkToken)
 {
     if (is_string($passwordLinkToken) && !empty($passwordLinkToken)) {
         $customer->setRpToken($passwordLinkToken);
         $customer->setRpTokenCreatedAt($this->dateTime->now());
         $this->saveAttribute($customer, 'rp_token');
         $this->saveAttribute($customer, 'rp_token_created_at');
     }
     return $this;
 }