0
votes

I have: Symfony 2, UserBundle (there is no controller, only Entities User, Roles and not used entity Data ).

I want (controller): $user = $this->getUser(); // return a User object (\UserBundle\Entity\User) $user->getData(); // there is a custom method in User object that get a data from Database (table UserData, for example)

How can i do that?

Where should be my "getData" function?

1

1 Answers

0
votes

Imo, you should override User entity and add oneToMeny to UserData entity. Correct me if i'm wrong