Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ConstraintViolation.php

function ConstraintViolation::__construct

Creates a new constraint violation.

Parameters

string|\Stringable $message The violation message as a string or a stringable object:

string|null $messageTemplate The raw violation message:

array $parameters The parameters to substitute in the: raw violation message

mixed $root The value originally passed to the: validator

string|null $propertyPath The property path from the root: value to the invalid value

mixed $invalidValue The invalid value that caused this: violation

int|null $plural The number for determining the plural: form when translating the message

string|null $code The error code of the violation:

Constraint|null $constraint The constraint whose validation: caused the violation

mixed $cause The cause of the violation:

File

vendor/symfony/validator/ConstraintViolation.php, line 41

Class

ConstraintViolation
Default implementation of {@ConstraintViolationInterface}.

Namespace

Symfony\Component\Validator

Code

public function __construct(string|\Stringable $message, ?string $messageTemplate, array $parameters, mixed $root, ?string $propertyPath, mixed $invalidValue, ?int $plural = null, ?string $code = null, ?Constraint $constraint = null, mixed $cause = null) {
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal