You could also force partial objects, to get rid off lazy-loading:
use Doctrine\ORM\Query;
//...
$query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true);
More Related Contents:
- Count Rows in Doctrine QueryBuilder
- Using Relationships with Multiple Entity Managers
- symfony2: how to use group_concat in QueryBuilder
- The EntityManager is closed
- Symfony 2: Creating a service from a Repository
- Symfony2 and Doctrine – Error: Invalid PathExpression. Must be a StateFieldPathExpression
- How to convert this to Doctrine 2 QueryBuilder format?
- How to configure naming strategy in Doctrine 2
- On delete cascade with doctrine2
- How do I read configuration settings from Symfony2 config.yml?
- How to encode Doctrine entities to JSON in Symfony 2.0 AJAX application?
- Why composer install timeouts after 300 seconds?
- How can I access a service outside of a controller with Symfony2?
- What is the new Symfony 3 directory structure?
- Get current URL in Twig template?
- Is there a way to specify Doctrine2 Entitymanager implementation class in Symfony2?
- How does the login check_path route work without default controller/action?
- The method name must start with either findBy or findOneBy. Undefined method Symfony?
- Doctrine – A new entity was found through the relationship
- Call PHP function from Twig template
- Symfony 2.0 getting service inside entity
- Doctrine query builder using inner join with conditions
- How to force Doctrine to update array type fields?
- Twig: render vs include
- INNER JOIN Results from Select Statement using Doctrine QueryBuilder
- How to get list of all routes of a controller in Symfony2?
- Memory leaks Symfony2 Doctrine2 / exceed memory limit
- Symfony2 error 500 instead of 404 at production
- Symfony2 default locale in routing
- symfony2 chained selectors