You are here

public function ExecutionContextInterface::addViolation in Plug 7

Adds a violation at the current node of the validation graph.

Note: the parameters $invalidValue, $plural and $code are deprecated since version 2.5 and will be removed in 3.0.

@api

Parameters

string $message The error message:

array $params The parameters substituted in the error message:

mixed $invalidValue The invalid, validated value:

int|null $plural The number to use to pluralize of the message:

int|null $code The violation code:

2 methods override ExecutionContextInterface::addViolation()
ExecutionContext::addViolation in lib/Symfony/validator/Symfony/Component/Validator/ExecutionContext.php
Adds a violation at the current node of the validation graph.
ExecutionContext::addViolation in lib/Symfony/validator/Symfony/Component/Validator/Context/ExecutionContext.php
Adds a violation at the current node of the validation graph.

File

lib/Symfony/validator/Symfony/Component/Validator/ExecutionContextInterface.php, line 104

Class

ExecutionContextInterface
Stores the validator's state during validation.

Namespace

Symfony\Component\Validator

Code

public function addViolation($message, array $params = array(), $invalidValue = null, $plural = null, $code = null);