#6081: Add new field in model->find to handle "having" ----------------------------+----------------------------------------------- Reporter: ebadedude | Owner: Type: Enhancement | Status: new Priority: Medium | Milestone: Component: General | Version: Severity: Normal | Resolution: Keywords: | Php_version: n/a Cake_version: | ----------------------------+----------------------------------------------- Comment (by mensler):
We overwrote the find() method in AppModel to support HAVING conditions, maybe this helps: {{{ public function find($conditions = null, $fields = array(), $order = null, $recursive = null) { if (is_array($fields) && !empty($fields['having']) && !empty($fields['group'])) { if (!is_array($fields['group'])) { $fields['group'] = array($fields['group']); } $ds = $this->getDataSource(); $having = $ds->conditions($fields['having'], true, false); $fields['group'][count($fields['group']) - 1] .= " HAVING $having"; } return parent::find($conditions, $fields, $order, $recursive); } }}} -- Ticket URL: <https://trac.cakephp.org/ticket/6081#comment:3> CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/> Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tickets cakephp" group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~----------~----~----~----~------~----~------~--~---