Wednesday, April 1, 2009

containable group by

Is there a way to add a "group by" clause into a "contain"?

$this->find('all', array(
'conditions' => $conditions,
'contain' => array(
'Vote' => array(
'fields' =>
array('SUM(Vote.rank)/COUNT(Vote.id) AS rank'),
// 'group' =>
array('Post.id') <--- this is not working
),
'Author' => array( 'fields'
=> array(' Author.name, Author.surname' ))
),
'page'=>$order,
'limit'=>$limit,
'order'=>$order,
'fields'=>$fields,
)
);

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: