Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Edit.php
Go to the documentation of this file.
1 <?php
7 
10 
19 {
25  protected function getFormData()
26  {
27  $data = $this->getData('form_data');
28  if ($data === null) {
29  $formData = $this->customerSession->getCustomerFormData(true);
30  $data = [];
31  if ($formData) {
32  $data['data'] = $formData;
33  $data['customer_data'] = 1;
34  }
35  $this->setData('form_data', $data);
36  }
37  return $data;
38  }
39 
47  public function restoreSessionData(\Magento\Customer\Model\Metadata\Form $form, $scope = null)
48  {
49  $formData = $this->getFormData();
50  if (isset($formData['customer_data']) && $formData['customer_data']) {
51  $request = $form->prepareRequest($formData['data']);
52  $data = $form->extractData($request, $scope, false);
53  $form->restoreData($data);
54  }
55 
56  return $this;
57  }
58 
66  public function getChangePassword()
67  {
68  return $this->customerSession->getChangePassword();
69  }
70 
77  public function getMinimumPasswordLength()
78  {
79  return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);
80  }
81 
89  {
90  return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_REQUIRED_CHARACTER_CLASSES_NUMBER);
91  }
92 }
getData($key='', $index=null)
Definition: DataObject.php:119
setData($key, $value=null)
Definition: DataObject.php:72
restoreSessionData(\Magento\Customer\Model\Metadata\Form $form, $scope=null)
Definition: Edit.php:47