Question

I'm looking for best practices to fill a dropdown with certain entities. There is a rolesystem in which a table holds the permission for the entities. So imagine objects projects, users and userProjects. Last one contains userId, projectId and a few permission. In a form the user can choose those projects for which the user is granted.

Sure there are many ways to achieve this. For example a certain central service could return a prepared querybuilder that can be passed to entity form type. But in my opinion the more atractive solution would be a service that returns an ArrayCollection of granted entities. But how to bind them on a choice control? I guess that would be a good job for a modeltransformer but .. what would you recommend?

Many thanks in advance!

Was it helpful?

Solution

If you really want it - create EntityChoiceList and pass it to form as choice_list to choice field.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top