Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
CustomerAuthUpdate Class Reference

Public Member Functions

 __construct (\Magento\Customer\Model\CustomerRegistry $customerRegistry, \Magento\Customer\Model\ResourceModel\Customer $customerResourceModel)
 
 saveAuth ($customerId)
 

Protected Attributes

 $customerRegistry
 
 $customerResourceModel
 

Detailed Description

Customer Authentication update model.

Definition at line 12 of file CustomerAuthUpdate.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Customer\Model\CustomerRegistry  $customerRegistry,
\Magento\Customer\Model\ResourceModel\Customer  $customerResourceModel 
)
Parameters
\Magento\Customer\Model\CustomerRegistry$customerRegistry
\Magento\Customer\Model\ResourceModel\Customer$customerResourceModel

Definition at line 28 of file CustomerAuthUpdate.php.

31  {
32  $this->customerRegistry = $customerRegistry;
33  $this->customerResourceModel = $customerResourceModel;
34  }

Member Function Documentation

◆ saveAuth()

saveAuth (   $customerId)

Reset Authentication data for customer.

Parameters
int$customerId
Returns
$this

Definition at line 42 of file CustomerAuthUpdate.php.

43  {
44  $customerSecure = $this->customerRegistry->retrieveSecureData($customerId);
45 
46  $this->customerResourceModel->getConnection()->update(
47  $this->customerResourceModel->getTable('customer_entity'),
48  [
49  'failures_num' => $customerSecure->getData('failures_num'),
50  'first_failure' => $customerSecure->getData('first_failure'),
51  'lock_expires' => $customerSecure->getData('lock_expires'),
52  ],
53  $this->customerResourceModel->getConnection()->quoteInto('entity_id = ?', $customerId)
54  );
55 
56  return $this;
57  }

Field Documentation

◆ $customerRegistry

$customerRegistry
protected

Definition at line 17 of file CustomerAuthUpdate.php.

◆ $customerResourceModel

$customerResourceModel
protected

Definition at line 22 of file CustomerAuthUpdate.php.


The documentation for this class was generated from the following file: