Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add OneToOne mapping between user and user_one #140

Open
Holicz opened this issue Jan 25, 2017 · 0 comments
Open

How to add OneToOne mapping between user and user_one #140

Holicz opened this issue Jan 25, 2017 · 0 comments

Comments

@Holicz
Copy link

Holicz commented Jan 25, 2017

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant