You may need to write your own validation constraint to verify uniqueness in this case.
It is logically incomprehensible how the UniqueEntity constraint is applied in this case. Are all extending classes checked for property uniqueness or only for the current class?
Because the UniqueEntity constraint looks for the uniqueness of a property in the table, the second option is not covered by the default behavior. Therefore, you cannot use the restriction for an extensible class with a single table overlay at this time.
Regarding the comments:
FOSUserBundle does not include the UniqueEntity constraint in config / validaton.xml .
... but it can be found for orm, mongodb, couchdb and propel, i.e. in config / orm / orm.xml .
FOSUserBundle uses @MappedSuperClass instead of merged table inheritance.
source share