class NoFieldItemsExistWithHigherCardinality

Checks if field items exist that exceed the allowed cardinality.

Attributes

#[Constraint(id: 'NoFieldItemsExistWithHigherCardinality', label: new TranslatableMarkup('No field items exist with higher cardinality', [], [ 'context' => 'Validation', ]))]

Hierarchy

Expanded class hierarchy of NoFieldItemsExistWithHigherCardinality

1 file declares its use of NoFieldItemsExistWithHigherCardinality
NoFieldItemsExistWithHigherCardinalityTest.php in core/modules/field/tests/src/Unit/Plugin/Validation/Constraint/NoFieldItemsExistWithHigherCardinalityTest.php

File

core/modules/field/src/Plugin/Validation/Constraint/NoFieldItemsExistWithHigherCardinality.php, line 14

Namespace

Drupal\field\Plugin\Validation\Constraint
View source
class NoFieldItemsExistWithHigherCardinality extends SymfonyConstraint {
  public function __construct(public string $entityType, public string $fieldName, public string $message = "The field '@field_name' of entity type '@entity_type' has more entries (@max_delta) than the cardinality (@cardinality) allows.", ?array $groups = NULL, mixed $payload = NULL) {
    parent::__construct(groups: $groups, payload: $payload);
  }

}

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