I have an entity Shop
and a related entity ShopProduct
, with the following relation:
/**
* @OR
Just encountered the same problem and the solution was very simple:
{{ value.getAlerts.count() }}
instead of
{{ value.getAlerts.count }}
Twig must be overriding the Doctrine count()
method meant to "Extra Lazy Load" with a variant of it's own implementation that just dumbly fetches all entities to count them.
That turned all expected SELECT * queries into COUNT(*)...