I am trying to solve a hopefully simple problem here is the query I am trying produce:
SELECT `categories`.*, COUNT(`entities`.id)
FROM `categories`
LEFT JOIN `entities` ON (`categories`.`id` = `entities`.`category_id`)
GROUP BY `categories`.`id`
I am really struggling to do this is in cakePHP 1.2
How would/should I go about doing this... (I am using 'Containable' if that helps)
Thanks in advance