class ProtectedUserFieldConstraint

Same name and namespace in other branches
  1. 11.x core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraint.php \Drupal\user\Plugin\Validation\Constraint\ProtectedUserFieldConstraint
  2. 10 core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraint.php \Drupal\user\Plugin\Validation\Constraint\ProtectedUserFieldConstraint
  3. 9 core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraint.php \Drupal\user\Plugin\Validation\Constraint\ProtectedUserFieldConstraint
  4. 8.9.x core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraint.php \Drupal\user\Plugin\Validation\Constraint\ProtectedUserFieldConstraint

Checks if the plain text password is provided for editing a protected field.

Attributes

#[Constraint(id: 'ProtectedUserField', label: new TranslatableMarkup('Password required for protected field change', [], [ 'context' => 'Validation', ]))]

Hierarchy

Expanded class hierarchy of ProtectedUserFieldConstraint

1 file declares its use of ProtectedUserFieldConstraint
ProtectedUserFieldConstraintValidatorTest.php in core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php

File

core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraint.php, line 13

Namespace

Drupal\user\Plugin\Validation\Constraint
View source
class ProtectedUserFieldConstraint extends SymfonyConstraint {
  public function __construct(mixed $options = NULL, public $message = "Your current password is missing or incorrect; it's required to change the %name.", ?array $groups = NULL, mixed $payload = NULL) {
    parent::__construct($options, $groups, $payload);
  }

}

Members

Title Sort descending Modifiers Object type Summary
ProtectedUserFieldConstraint::__construct public function #[HasNamedArguments]

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.