Permalink
Browse files

Torna compatível com Symfony 2.3

  • Loading branch information...
Eher
Eher committed Jun 11, 2013
1 parent a92b365 commit 4a83c575b74011a5b3267f3c3dfc3768bfd70588
Showing with 10 additions and 0 deletions.
  1. +10 −0 Validator/Constraints/CpfcnpjValidator.php
@@ -17,6 +17,16 @@
class CpfcnpjValidator extends ConstraintValidator
{
public function isValid($value, Constraint $constraint)
{
return $this->validate($value, $constraint);
}
public function setMessage($message, $value)
{
$this->context->addViolation($message, $value);
}
public function validate($value, Constraint $constraint)
{
if (!$constraint->aceitar) {
throw new ConstraintDefinitionException('É necessário definer a opção "aceitar" da restrição.');

0 comments on commit 4a83c57

Please sign in to comment.