Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CustomerAuthUpdate.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Customer\Model;
8 
13 {
17  protected $customerRegistry;
18 
23 
28  public function __construct(
31  ) {
32  $this->customerRegistry = $customerRegistry;
33  $this->customerResourceModel = $customerResourceModel;
34  }
35 
42  public function saveAuth($customerId)
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  }
58 }
__construct(\Magento\Customer\Model\CustomerRegistry $customerRegistry, \Magento\Customer\Model\ResourceModel\Customer $customerResourceModel)