PUGX / PUGXMultiUserBundle

An extension for FOSUserBundle to handle users of different types. Compatible with Doctrine ORM.
163 stars 96 forks source link

How to add OneToOne mapping between user and user_one #140

Open Holicz opened 7 years ago

Holicz commented 7 years ago

Hello, I have installed and configured this bundle and I am currently stucked at this.

I have User class with this properties: ID (e.g. a1f6e80c-e342-11e6-8657-d144e2a286b5 - UUID) ... type (e.g. user_one)

And I want to achieve this with User class ID ... user_one (ID of record in user_one table) user_two (NULL, if user is of type user_one) type (e.g. user_one)

Why I want to do this? Because now, when I want to read user_one I must bind it from database by ID. If I would have it as I show in the second example I could do simply this in twig:

{{ app.user.user_one.name }}

Is this possible and how? Sorry for my bad english...