I'm developing in PHP using the symfony framework however the question applies more broadly to non-symfony and non-PHP developers also. (For symfony developers, I am using single table inheritance mapping to map the sub-classes to the DB using Doctrine ORM, BasePerson extends FOSUserBundle which is then further extended by two sub-classes.)
"BasePerson" extends the original User class which is further extended into two seperate sub-classes: photographer, PhotoSubject.
Having sub-classes is a nice seperation of logic, however the issue arises when I have a photographer that is also a PhotoSubject. They would share the same email address, but different usernames (in the User class).
However now I have two objects for the same person (the same User): a PhotoSubject and a Photographer, both with different usernames and with potentially different passwords etc which is obviously not possible in Doctrine - they need to be stored as two seperate DB records with differen usernames. Having two different logins for the same user seems like a design problem to me.
Can anyone suggest the correct design for this problem? Should I not use inheritance at all to avoid this problem and instead have a monolithic "BasePerson" class that isn't extended. Should I somehow check the database for another "person" with the same email address when a user logs in? Or is there another solution to this problem?