I have a custom text field in a module that the user populate with an EAN number. The input is getting validate by a "match" validator and then is serialized before save to get ride of the various variants of the EAN the user can enter ("978-2-87929-647-0", "978.2.87929.647.0" and so on…). But now I need to validate is uniqueness and I can't find the right way to do this.
How can I normalize the input and then test if this normalized value already exists in the DB?
I cannot find a way to get the actual user input and normalize it before validate it.
I guess I have to use the "UniqueValidator" to test if the entry already exists in the DB.
Thanks for your help.