Hi!
Currently, I am developing an application which domain model should prevent objects duplication according the equality or not of some object fields.
So, I am thinking to handle this comparison on the save method of the class: if some existing object has some properties equal to the object to be saved, the save should be prevented.
I am thinking to deal this situation with an Exceptions, which would be thrown and catched in the action, in order to present a message to the user, if necessary. Unfortunately, my knowledge about Exceptions is not quite good and more: would be this solution the most adequate?
The ORM which I am using is Doctrine.
Thanks in advance for the help, Best regards!