Trouble converting CASE statement SQL to Cake Query

You can use as is with the db connection. PDO instance example: Count and group by