The follow is an SQL statement generated by my Cook Component
SELECT a.id,a.checked_out,a.created_by,a.published,a.category,a.logo,a.name,a.summary,_category_.category AS `_category_category`,_checked_out_.name AS `_checked_out_name`,COUNT(_deals_.id) AS `_deals_count`
FROM vl9d3_comp_venues AS a
LEFT JOIN `vl9d3_comp_venuecategories` AS _category_
ON _category_.id = a.category
LEFT JOIN `vl9d3_users` AS _checked_out_
ON _checked_out_.id = a.checked_out
LEFT JOIN `vl9d3_comp_deals` AS _deals_
ON _deals_.pin = a.id
WHERE (0 OR 1)
ORDER BY a.category,a.ordering asc
LIMIT 0, 20
However whereas this returns only 1 result, it should be returning every single venue (4 in total)
The problem is that the SQL should be
SELECT a.id,a.checked_out,a.created_by,a.published,a.category,a.logo,a.name,a.summary,_category_.category AS `_category_category`,_checked_out_.name AS `_checked_out_name`,COUNT(_deals_.id) AS `_deals_count`
FROM vl9d3_comp_venues AS a
LEFT JOIN `vl9d3_comp_venuecategories` AS _category_
ON _category_.id = a.category
LEFT JOIN `vl9d3_users` AS _checked_out_
ON _checked_out_.id = a.checked_out
LEFT JOIN `vl9d3_comp_deals` AS _deals_
ON _deals_.pin = a.id
WHERE (0 OR 1)
GROUP BY a.id
ORDER BY a.category,a.ordering asc
LIMIT 0, 20
However the groupBy class has been depreciated with no replacement. I have tried readding it with no success and various messing with the prepareQuery to try and inject it with, again, no success
How can I insert this essential GROUP BY statement with majorly hacking the code and why was it removed when it is sometimes essenial?