I'm trying to use dynamic form generation as described here
http://symfony.com/doc/current/cookbook/form/dynamic_form_generation.html
In my EventSubscriber I'm adding Entity-type fields with a custom query builder. No matter if I use the custom query builder or a function in the repository class of the entity, I cannot access other services. I need the security.context to add information about the currently logged in user to my query. What is the best way to achieve this?
It seems wrong to pass a service to the form contructor that passes the service to the event subscriber constructor which uses the service to return a query builder, doesn't it?
