$userId =
$constraint->
getUserId();
if (empty($email)) { $this->
addError($this->
getSnippet(NoUrlValidator::SNIPPET_EMPTY_FIELD
));
} if (!
$this->emailValidator->
isValid($email)) { $this->
addError($this->
getSnippet(self::SNIPPET_MAIL_FAILURE
));
} if ($this->
isExistingEmail($email,
$userId)) { $this->
addError($this->
getSnippet(self::SNIPPET_MAIL_DUPLICATE
));
} } /**
* @param string $message
*/
private function addError($message) { $this->context
->
buildViolation($message)