You are here

public function ConstraintViolation::__construct in Plug 7

Creates a new constraint violation.

Parameters

string $message The violation message:

string $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 $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

mixed $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

lib/Symfony/validator/Symfony/Component/Validator/ConstraintViolation.php, line 91

Class

ConstraintViolation
Default implementation of {@ConstraintViolationInterface}.

Namespace

Symfony\Component\Validator

Code

public function __construct($message, $messageTemplate, array $parameters, $root, $propertyPath, $invalidValue, $plural = null, $code = null, Constraint $constraint = null, $cause = null) {
  $this->message = $message;
  $this->messageTemplate = $messageTemplate;
  $this->parameters = $parameters;
  $this->plural = $plural;
  $this->root = $root;
  $this->propertyPath = $propertyPath;
  $this->invalidValue = $invalidValue;
  $this->constraint = $constraint;
  $this->code = $code;
  $this->cause = $cause;
}