class RoleExistsConstraint

Same name and namespace in other branches
  1. 11.x core/modules/user/src/Plugin/Validation/Constraint/RoleExistsConstraint.php \Drupal\user\Plugin\Validation\Constraint\RoleExistsConstraint

Checks if a role exists.

Attributes

#[Constraint(id: 'RoleExists', label: new TranslatableMarkup('Role exists', [], [ 'context' => 'Validation', ]))]

Hierarchy

  • class \Drupal\user\Plugin\Validation\Constraint\RoleExistsConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of RoleExistsConstraint

1 file declares its use of RoleExistsConstraint
RoleExistsConstraintValidatorTest.php in core/modules/user/tests/src/Kernel/Plugin/Validation/Constraint/RoleExistsConstraintValidatorTest.php

File

core/modules/user/src/Plugin/Validation/Constraint/RoleExistsConstraint.php, line 15

Namespace

Drupal\user\Plugin\Validation\Constraint
View source
class RoleExistsConstraint extends SymfonyConstraint {
  public function __construct(mixed $options = NULL, public $message = "The role with id '@rid' does not exist.", ?array $groups = NULL, mixed $payload = NULL) {
    parent::__construct($options, $groups, $payload);
  }

}

Members

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

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