Doctrine 1

Count query with join o2m + limit + where throws an exception