PUGX / PUGXMultiUserBundle

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

entity manager #56

Open DavKi opened 10 years ago

DavKi commented 10 years ago

Hi,

I've got 2 user entities in my UserBundle and 2 groups. Each group has an attribute 'admin' (which is a one-to-many relationship) and an attribute 'users' (which is a many-to-many relationship).

In my group forms, i'd like to be able to choose an admin and several users. My problem is when I do this, the inverse side of my relationships (users and admin) aren't update. So I tried to pass the option 'by_reference => false' to my form fields. But now I have the following error :

"Entities passed to the choice field must be managed. Maybe persist them in the entity manager?"

So what I'd like to do know is pass the user manager to the form field, but the option 'em' requires a string as a parameter, and I don't know where to find the user manager name.

leopro commented 10 years ago

but the option 'em' requires a string as a parameter

try with 'default'

DavKi commented 10 years ago

Default is not working, I'va already tried.