RoleExistsConstraint.php

Same filename and directory in other branches
  1. 11.x core/modules/user/src/Plugin/Validation/Constraint/RoleExistsConstraint.php

Namespace

Drupal\user\Plugin\Validation\Constraint

File

core/modules/user/src/Plugin/Validation/Constraint/RoleExistsConstraint.php

View source
<?php

declare (strict_types=1);
namespace Drupal\user\Plugin\Validation\Constraint;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Attribute\HasNamedArguments;
use Symfony\Component\Validator\Constraint as SymfonyConstraint;

/**
 * Checks if a role exists.
 */
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);
  }

}

Classes

Title Deprecated Summary
RoleExistsConstraint Checks if a role exists.

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