Reputation: 164
So I have a form that lets a user create a new team. Our team entity has a teamPidone and teamPidtwo which are FK's to our accounts table. By using the default
builder->add('teamPidtwo')
It creates a drop down and somehow the drop down has the UserNames of all our users, this is what I want but it also includes the user that is making the team. Since a user can not be both teamPidone and teamPidtwo I would like to somehow edit the drop down to not include the current user. Since I'm not sure exactly how its bringing in the UserNames because the FK's only correspond to Account ID's not their names I'm unsure how to go about this.
Thanks
Upvotes: 1
Views: 2410
Reputation: 1876
Try to use a custom query http://symfony.com/doc/current/reference/forms/types/entity.html
Upvotes: 1