I have a user sign-up form. One of the things this form must do is enforce the uniqueness of the new user's email address. In other words, the new user's email address must not be an email address already used by someone else.

I haven't yet been able to find an acceptable solution to this problem, which is somewhat surprising given how simple and common this need is (and how simple and easy the solution is in Rails!).

I've seen [this question/answer](https://stackoverflow.com/questions/7600379/symfony-2-unique-validator), but the problem with that solution is that it seems to validate "uniqueness" not only on the creation of a record, but every time you try to update the record as well. So once a record is saved, you can't update it ever again because it tells you the email address is already being used. (Perhaps I'm implementing their solution wrong, but it doesn't seem like I am.)

Does anyone have a working example (not just a link to the [docs](http://symfony.com/doc/current/book/validation.html), please, which I've already read) of a uniqueness validator on an entity/form?