class NotNullConstraint

Same name in other branches
  1. 9 core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/NotNullConstraint.php \Drupal\Core\Validation\Plugin\Validation\Constraint\NotNullConstraint
  2. 10 core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/NotNullConstraint.php \Drupal\Core\Validation\Plugin\Validation\Constraint\NotNullConstraint
  3. 11.x core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/NotNullConstraint.php \Drupal\Core\Validation\Plugin\Validation\Constraint\NotNullConstraint

NotNull constraint.

Overrides the symfony constraint to handle empty Typed Data structures.

Plugin annotation


@Constraint(
  id = "NotNull",
  label = @Translation("NotNull", context = "Validation"),
  type = false
)

Hierarchy

  • class \Drupal\Core\Validation\Plugin\Validation\Constraint\NotNullConstraint extends \Symfony\Component\Validator\Constraints\NotNull

Expanded class hierarchy of NotNullConstraint

1 file declares its use of NotNullConstraint
ModerationStateConstraintValidator.php in core/modules/content_moderation/src/Plugin/Validation/Constraint/ModerationStateConstraintValidator.php

File

core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/NotNullConstraint.php, line 18

Namespace

Drupal\Core\Validation\Plugin\Validation\Constraint
View source
class NotNullConstraint extends NotNull {

}

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