function UserNameUnique::__construct

Same name and namespace in other branches
  1. 11.x core/modules/user/src/Plugin/Validation/Constraint/UserNameUnique.php \Drupal\user\Plugin\Validation\Constraint\UserNameUnique::__construct()

Constructs a UniqueFieldConstraint object.

Parameters

bool $caseSensitive: This constraint is case-insensitive by default. For example, "FOO" and "foo" would be considered as equivalent, and validation of the constraint would fail.

string $message: The error message.

array|null $groups: The groups that the constraint belongs to.

mixed|null $payload: Domain-specific data attached to a constraint.

Overrides UniqueFieldConstraint::__construct

File

core/modules/user/src/Plugin/Validation/Constraint/UserNameUnique.php, line 18

Class

UserNameUnique
Checks if a user name is unique on the site.

Namespace

Drupal\user\Plugin\Validation\Constraint

Code

public function __construct(bool $caseSensitive = FALSE, $message = 'The username %value is already taken.', ?array $groups = NULL, mixed $payload = NULL) {
  parent::__construct($caseSensitive, $message, $groups, $payload);
}

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