Hi
I've trying to use the validation Constraint "Callback" using the
validation.yml:

Heineken\PublicBundle\ats\request\AltaAllRequest:
    constraints:
        repwd:
            - Callback:
                 methods: [isRePwdValid]

And the class that symple method:
 public function isRePwdValid(ExecutionContext $context){
        if($this->pwd!=$this->repwd){
            $context->addViolation('(La contraseƱa no coincide)',
array(), null);
        }
    }
And gives me that error:
Catchable Fatal Error: Argument 1 passed to Symfony\Component\Validator
\Mapping\ClassMetadata::addConstraint() must be an instance of Symfony
\Component\Validator\Constraint, array given, called in C:\xampp\htdocs
\heineken\vendor\symfony\src\Symfony\Component\Validator\Mapping\Loader
\YamlFileLoader.php on line 60 and defined in C:\xampp\htdocs\heineken
\vendor\symfony\src\Symfony\Component\Validator\Mapping
\ClassMetadata.php line 101

Anyone uses it before and can help me?

Thanks

--
Best Regards

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to