From Doctrine Query to QueryBuilder in a Simfony2 entity field type
问题 I'm using the entity Field Type in a Symfony2.1 form. Here, I'm going to use the query_builder param to return only entities that matches a long-complex query (see the example in the official docs). Obviously the query_builder param for the entity field type accepts a Doctrine QueryBuilder object. On the other side, I have large entity repositories with complex DQL queries obtained by the EntityManager 's createQuery() function which returns a Doctrine Query object. So, I cannot directly use