I’m trying to modify the way FOSUSerBundle validates the username/email when the user registers, because I need to check if the user was previously registered, but he has unsubscribed, through status flag in the entity. I think the best way is check if email is previously on the database, excluding those who the flag unsubscribed is set to true, but how I do this?
So, I see how validates with UniqueValidator class, but I don’t understand how it works. It would be great if anyone could explain it too.
Thanks.
UniqueValidatorcalls validateUnique method ofUserManagerclass. You can extend the class and modify the function to check userEdit
For second question, you have to override
UpdateUsermethod of theUserManagerclass.