I'm using Symfony 2.5 and my Model class is the following:
/**
* @UserAssert\UserPasswordReset
*/
class ResetPassword {
/**
* @var string
* @Assert\NotBlank()
*/
public $username;
/**
* @var string
* @Assert\NotBlank()
* @Assert\Date
*/
public $birthday;
/**
* @var string
* @Assert\NotBlank()
*/
public $plainSecurityAnswer;
function __toString()
{
return $this->username . $this->birthday->format('Y-m-d H:i:s') . $this->plainSecurityAnswer;
}
}
This Model is mapped to a ResetFormType. Now my intention: How can i say / configure, that i first want the property constraints to be passed. And if all property constraints are passed (e.g. no field is blank), i want the @UserAssert\UserPasswordReset to be called.
At the moment, it always validates the property AND the class constraints.
Regards ++