You are here

public function ExecutionContextInterface::getValidator in Plug 7

Returns the validator.

Useful if you want to validate additional constraints:

public function validate($value, Constraint $constraint) { $validator = $this->context->getValidator();

$violations = $validator->validateValue($value, new Length(array('min' => 3)));

if (count($violations) > 0) { // ... } }

Return value

ValidatorInterface

1 method overrides ExecutionContextInterface::getValidator()
ExecutionContext::getValidator in lib/Symfony/validator/Symfony/Component/Validator/Context/ExecutionContext.php
Returns the validator.

File

lib/Symfony/validator/Symfony/Component/Validator/Context/ExecutionContextInterface.php, line 101

Class

ExecutionContextInterface
The context of a validation run.

Namespace

Symfony\Component\Validator\Context

Code

public function getValidator();