I have a user entity, and multiple profile entities. What I'm trying to do is dynamically create a oneToOne relationship based on the user role.
So picture my 3 tables:
users (core table, username, pass, role etc, used for authentication)
users_admin
users_client
Then in my User.orm.yml I have:
oneToOne:
--profile:
----targetEntity: \UserBundle\Entity\Profile
----mappedBy: user
The problem is I need the targetEntity to either be:
AdminProfile
ClientProfile
Based on role. Is there any links or advice? I'm completely lost at where to start so appreciate any input on how I might achieve this.