function ProtectedUserFieldConstraintValidator::__construct

Same name in other branches
  1. 8.9.x core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidator.php \Drupal\user\Plugin\Validation\Constraint\ProtectedUserFieldConstraintValidator::__construct()
  2. 10 core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidator.php \Drupal\user\Plugin\Validation\Constraint\ProtectedUserFieldConstraintValidator::__construct()
  3. 11.x core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidator.php \Drupal\user\Plugin\Validation\Constraint\ProtectedUserFieldConstraintValidator::__construct()

Constructs the object.

Parameters

\Drupal\user\UserStorageInterface $user_storage: The user storage handler.

\Drupal\Core\Session\AccountProxyInterface $current_user: The current user.

File

core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidator.php, line 39

Class

ProtectedUserFieldConstraintValidator
Validates the ProtectedUserFieldConstraint constraint.

Namespace

Drupal\user\Plugin\Validation\Constraint

Code

public function __construct(UserStorageInterface $user_storage, AccountProxyInterface $current_user) {
    $this->userStorage = $user_storage;
    $this->currentUser = $current_user;
}

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