- Deprecated:
- 101.0.0 Customer password attribute backend
Definition at line 15 of file Password.php.
◆ __construct()
- Parameters
-
\Magento\Framework\Stdlib\StringUtils | $string | |
Definition at line 32 of file Password.php.
◆ beforeSave()
Special processing before attribute save: a) check some rules for password b) transform temporary attribute 'password' into real attribute 'password_hash'
- Parameters
-
\Magento\Framework\DataObject | $object | |
- Returns
- void
- Exceptions
-
Implements BackendInterface.
Definition at line 46 of file Password.php.
48 $password = $object->getPassword();
50 $length = $this->
string->strlen($password);
52 if ($length < self::MIN_PASSWORD_LENGTH) {
53 throw new LocalizedException(
55 'The password needs at least %1 characters. Create a new password and try again.',
56 self::MIN_PASSWORD_LENGTH
61 if (trim($password) !== $password) {
62 throw new LocalizedException(
63 __(
"The password can't begin or end with a space. Verify the password and try again.")
67 $object->setPasswordHash($object->hashPassword($password));
◆ validate()
- Deprecated:
- 101.0.0
- Parameters
-
\Magento\Framework\DataObject | $object | |
- Returns
- bool
Definition at line 76 of file Password.php.
78 $password = $object->getPassword();
79 if ($password && $password === $object->getPasswordConfirm()) {
83 return parent::validate($object);
◆ $string
◆ MIN_PASSWORD_LENGTH
const MIN_PASSWORD_LENGTH = 6 |
The documentation for this class was generated from the following file:
- vendor/magento/module-customer/Model/Customer/Attribute/Backend/Password.php