class StringEqualsConcatenatedValuesConstraint

Checks a string consists of specific values found in the mapping.

Attributes

#[Constraint(id: 'StringEqualsConcatenatedValues', label: new TranslatableMarkup('String consists of specific values.', [], [ 'context' => 'Validation', ]))]

Hierarchy

Expanded class hierarchy of StringEqualsConcatenatedValuesConstraint

1 file declares its use of StringEqualsConcatenatedValuesConstraint
StringEqualsConcatenatedValuesConstraintValidatorTest.php in core/tests/Drupal/KernelTests/Core/Validation/StringEqualsConcatenatedValuesConstraintValidatorTest.php

File

core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/StringEqualsConcatenatedValuesConstraint.php, line 14

Namespace

Drupal\Core\Validation\Plugin\Validation\Constraint
View source
class StringEqualsConcatenatedValuesConstraint extends SymfonyConstraint {
  
  /**
   * The error message if the string does not match.
   *
   * @var string
   */
  public string $message = "Expected '@expected_string', not '@value'. Format: '@expected_format'.";
  
  /**
   * The separator separating the values.
   *
   * @var string
   */
  public string $separator;
  
  /**
   * Reserved characters — if any — that are to be substituted in each value.
   *
   * @var string[]
   */
  public array $reservedCharacters = [];
  
  /**
   * Any reserved characters that will be substituted by this character.
   *
   * @var ?string
   */
  public ?string $reservedCharactersSubstitute;
  
  /**
   * The mappings to values to concatenate together.
   *
   * @var array
   */
  public array $values;
  
  /**
   * {@inheritdoc}
   */
  public function getRequiredOptions() : array {
    return [
      'separator',
      'values',
    ];
  }

}

Members

Title Sort descending Modifiers Object type Summary
StringEqualsConcatenatedValuesConstraint::$message public property The error message if the string does not match.
StringEqualsConcatenatedValuesConstraint::$reservedCharacters public property Reserved characters — if any — that are to be substituted in each value.
StringEqualsConcatenatedValuesConstraint::$reservedCharactersSubstitute public property Any reserved characters that will be substituted by this character.
StringEqualsConcatenatedValuesConstraint::$separator public property The separator separating the values.
StringEqualsConcatenatedValuesConstraint::$values public property The mappings to values to concatenate together.
StringEqualsConcatenatedValuesConstraint::getRequiredOptions public function

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