コード例 #1
0
ファイル: Customer.php プロジェクト: shabbirvividads/magento2
 /**
  * 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
ファイル: Customer.php プロジェクト: Atlis/docker-magento2
 /**
  * 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;
 }