I'm trying to implement change password functionality in Symfony 2 project.
I have entity User with validation rules in validation.yml file. In User entity I have field "password" with its validation constraints in validation.yml.
I created form with 2 field 'password' and 'confirmPasswod'. I want to use my entity validation constraints for 'password' field and check equality between 'passwod' and 'confirmPassword' fields. In my contronller I write
$form = $this->createForm(new SymfonyForm\ChangePasswordType(), new Entity\User());
if ($form->isValid())
{..............}
In 'User' entity I don't have 'confirmPasswod' field. So I get error:
Neither property "confirmPassword" nor method "getConfirmPassword()" nor method "isConfirmPassword()" exists in class
Is there any way to use entity-based form validation for some form fields and not entity-based validation for other? Thanks in advance.