$this->db->select("category.id, category.title, COUNT(`post.id`) as posts_count")
->from('category')
->join('post','category.id = post.category_id')
->where(array('post.category_id !=' => NULL, 'category.id !=' => NULL))
->group_by(array("category.id", "category.title"))
->get();
protected function tryRunMethod(Object $controller, $method)
{
try {
$controller->$method();
} catch (\Exception $e) {
$this->sandResponseCode(Response::HTTP_METHOD_NOT_ALLOWED);
throw new \Exception($e);
}
}
protected function tryRunMethod(ControllerClass $controller, $method)
{
...
}