class PrimitiveTypeConstraint

Supports validating all primitive types.

@todo: Move this below the TypedData core component.

Plugin annotation


@Plugin(
  id = "PrimitiveType",
  label = @Translation("Primitive type", context = "Validation")
)

Hierarchy

Expanded class hierarchy of PrimitiveTypeConstraint

File

drupal/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/PrimitiveTypeConstraint.php, line 24
Contains \Drupal\Core\Validation\Plugin\Validation\Constraint\PrimitiveTypeConstraint.

Namespace

Drupal\Core\Validation\Plugin\Validation\Constraint
View source
class PrimitiveTypeConstraint extends SymfonyConstraint {
  public $message = 'This value should be of type %type.';

}

Members

Namesort descending Modifiers Type Description Overrides
Constraint::$groups public property
Constraint::addImplicitGroupName public function Adds the given group if this constraint is in the Default group
Constraint::CLASS_CONSTRAINT constant Marks a constraint that can be put onto classes
Constraint::DEFAULT_GROUP constant The name of the group given to all constraints with no explicit group
Constraint::getTargets public function Returns whether the constraint can be put onto classes, properties or both 7
Constraint::PROPERTY_CONSTRAINT constant Marks a constraint that can be put onto properties
Constraint::validatedBy public function Returns the name of the class that validates this constraint 2
Constraint::__construct public function Initializes the constraint with options. 10
Constraint::__set public function Unsupported operation.
PrimitiveTypeConstraint::$message public property Overrides Type::$message
Type::$type public property
Type::getDefaultOption public function Returns the name of the default option Overrides Constraint::getDefaultOption
Type::getRequiredOptions public function Returns the name of the required options Overrides Constraint::getRequiredOptions