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
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\ContextCode
public function getValidator();